From: Anatol Belski Date: Sat, 15 Apr 2017 12:28:58 +0000 (+0200) Subject: export the main thread info X-Git-Tag: php-7.2.0alpha1~102 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4d64a49fcd0218f2656e964d25d4e02d844c1e03;p=php export the main thread info --- diff --git a/TSRM/TSRM.c b/TSRM/TSRM.c index 2c7a40a2de..4c635a05a9 100644 --- a/TSRM/TSRM.c +++ b/TSRM/TSRM.c @@ -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 */ diff --git a/TSRM/TSRM.h b/TSRM/TSRM.h index 2ffcbfee76..3a06ccd8d5 100644 --- a/TSRM/TSRM.h +++ b/TSRM/TSRM.h @@ -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)