Skip to content

Commit

Permalink
Add info about thread API used
Browse files Browse the repository at this point in the history
  • Loading branch information
weltling committed Dec 21, 2017
1 parent 259085f commit e8db69f
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
15 changes: 15 additions & 0 deletions TSRM/TSRM.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */

/*
Expand Down
1 change: 1 addition & 0 deletions TSRM/TSRM.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions ext/standard/info.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e8db69f

Please sign in to comment.