mirror of
https://github.com/php/php-src.git
synced 2024-11-28 04:14:26 +08:00
Fix segfault. Compile param --with-tsrm-pth=yes
This commit is contained in:
parent
c2308d5d7c
commit
a46f952c0f
@ -93,7 +93,12 @@ static FILE *tsrm_error_file;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(PTHREADS)
|
||||
#if defined(GNUPTH)
|
||||
static pth_key_t tls_key;
|
||||
# define tsrm_tls_set(what) pth_key_setdata(tls_key, (void*)(what))
|
||||
# define tsrm_tls_get() pth_key_getdata(tls_key)
|
||||
|
||||
#elif defined(PTHREADS)
|
||||
/* Thread local storage */
|
||||
static pthread_key_t tls_key;
|
||||
# define tsrm_tls_set(what) pthread_setspecific(tls_key, (void*)(what))
|
||||
@ -125,6 +130,7 @@ TSRM_API int tsrm_startup(int expected_threads, int expected_resources, int debu
|
||||
{
|
||||
#if defined(GNUPTH)
|
||||
pth_init();
|
||||
pth_key_create(&tls_key, 0);
|
||||
#elif defined(PTHREADS)
|
||||
pthread_key_create( &tls_key, 0 );
|
||||
#elif defined(TSRM_ST)
|
||||
|
Loading…
Reference in New Issue
Block a user