com php-src: Add info about thread API used: TSRM/TSRM.c TSRM/TSRM.h ext/standard/info.c

From: Date: Thu, 21 Dec 2017 16:54:31 +0000
Subject: com php-src: Add info about thread API used: TSRM/TSRM.c TSRM/TSRM.h ext/standard/info.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-100653@lists.php.net to get a copy of this message
Commit: e8db69f3f799b67cf13906660dc5a58a7ea468eb Author: Anatol Belski <ab@php.net> Thu, 21 Dec 2017 17:54:31 +0100 Parents: 259085f2012833bd9fb02714db44cc21fbf6bc9b Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=e8db69f3f799b67cf13906660dc5a58a7ea468eb Log: Add info about thread API used Changed paths: M TSRM/TSRM.c M TSRM/TSRM.h M ext/standard/info.c Diff: diff --git a/TSRM/TSRM.c b/TSRM/TSRM.c index 72a57f5..9451ed1 100644 --- a/TSRM/TSRM.c +++ b/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 */ /* diff --git a/TSRM/TSRM.h b/TSRM/TSRM.h index 9ba9919..2ab1f44 100644 --- a/TSRM/TSRM.h +++ b/TSRM/TSRM.h @@ -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 diff --git a/ext/standard/info.c b/ext/standard/info.c index 3d920b6..d71ddd6 100644 --- a/ext/standard/info.c +++ b/ext/standard/info.c @@ -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

« previous php.cvs (#100653) next »