Add info about thread API used

This commit is contained in:
Anatol Belski 2017-12-21 17:54:31 +01:00
parent 259085f201
commit e8db69f3f7
3 changed files with 17 additions and 0 deletions

View file

@ -781,6 +781,21 @@ TSRM_API uint8_t tsrm_is_main_thread(void)
return in_main_thread;
}/*}}}*/
TSRM_API const char *tsrm_api_name(void)
{/*{{{*/
#if defined(GNUPTH)
return "GNU Pth";
#elif defined(PTHREADS)
return "POSIX Threads";
#elif defined(TSRM_ST)
return "State Threads";
#elif defined(TSRM_WIN32)
return "Windows Threads";
#else
return "Unknown";
#endif
}/*}}}*/
#endif /* ZTS */
/*

View file

@ -143,6 +143,7 @@ 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);
TSRM_API const char *tsrm_api_name(void);
#if defined(__cplusplus) && __cplusplus > 199711L
# define TSRM_TLS thread_local

View file

@ -870,6 +870,7 @@ PHPAPI void php_print_info(int flag)
#ifdef ZTS
php_info_print_table_row(2, "Thread Safety", "enabled" );
php_info_print_table_row(2, "Thread API", tsrm_api_name() );
#else
php_info_print_table_row(2, "Thread Safety", "disabled" );
#endif