]> granicus.if.org Git - php/commitdiff
export the main thread info
authorAnatol Belski <ab@php.net>
Sat, 15 Apr 2017 12:28:58 +0000 (14:28 +0200)
committerAnatol Belski <ab@php.net>
Sat, 15 Apr 2017 15:48:40 +0000 (17:48 +0200)
TSRM/TSRM.c
TSRM/TSRM.h

index 2c7a40a2de4503b36416ba48e68fbe6032bea56d..4c635a05a9f811a60017e7c68dabd5264b5f5632 100644 (file)
@@ -814,4 +814,9 @@ TSRM_API void *tsrm_get_ls_cache(void)
        return tsrm_tls_get();
 }
 
+TSRM_API uint8_t tsrm_is_main_thread(void)
+{
+       return in_main_thread;
+}
+
 #endif /* ZTS */
index 2ffcbfee76c7415fb86aae88de99d06a124cb0bf..3a06ccd8d5badaaa65116d1be4e828f323a641a8 100644 (file)
@@ -155,6 +155,7 @@ TSRM_API void *tsrm_set_interpreter_context(void *new_ctx);
 TSRM_API void tsrm_free_interpreter_context(void *context);
 
 TSRM_API void *tsrm_get_ls_cache(void);
+TSRM_API uint8_t tsrm_is_main_thread(void);
 
 #ifdef TSRM_WIN32
 # define TSRM_TLS __declspec(thread)