export the main thread info

This commit is contained in:
Anatol Belski 2017-04-15 14:28:58 +02:00
parent 6a2b48b4e5
commit 4d64a49fcd
2 changed files with 6 additions and 0 deletions

View 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 */

View 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)