mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Add info about thread API used
This commit is contained in:
parent
259085f201
commit
e8db69f3f7
3 changed files with 17 additions and 0 deletions
15
TSRM/TSRM.c
15
TSRM/TSRM.c
|
@ -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 */
|
||||
|
||||
/*
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue