summaryrefslogtreecommitdiff
path: root/TSRM
diff options
context:
space:
mode:
authorAnatol Belski <ab@php.net>2017-12-21 13:49:05 +0100
committerAnatol Belski <ab@php.net>2017-12-21 13:49:05 +0100
commitddd401859c0c0c311e70b964262d1274f4ca8035 (patch)
treee439c50f8f75323c7ad01d43391b62372823b387 /TSRM
parentdcc3f00090fc750f17aed4bf5ab4099bc91de75a (diff)
parenta46f952c0ffe4ea9436699fbaa91e8c6cdb319b0 (diff)
downloadphp-git-ddd401859c0c0c311e70b964262d1274f4ca8035.tar.gz
Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1: Fix segfault. Compile param --with-tsrm-pth=yes
Diffstat (limited to 'TSRM')
-rw-r--r--TSRM/TSRM.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/TSRM/TSRM.c b/TSRM/TSRM.c
index cde8437790..ed1f24f8b8 100644
--- a/TSRM/TSRM.c
+++ b/TSRM/TSRM.c
@@ -94,7 +94,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))
@@ -128,6 +133,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)