* PHP-7.1:
Fix segfault. Compile param --with-tsrm-pth=yes
# warning tsrm_set_interpreter_context is probably broken on this platform
#endif
+TSRM_TLS uint8_t in_main_thread = 0;
+
/* Startup TSRM (call once for the entire process) */
TSRM_API int tsrm_startup(int expected_threads, int expected_resources, int debug_level, char *debug_filename)
-{
+{/*{{{*/
#if defined(GNUPTH)
pth_init();
+ pth_key_create(&tls_key, 0);
#elif defined(PTHREADS)
pthread_key_create( &tls_key, 0 );
#elif defined(TSRM_ST)