]> granicus.if.org Git - php/commitdiff
MFZE1 - threading fix
authorZeev Suraski <zeev@php.net>
Tue, 17 Sep 2002 12:42:11 +0000 (12:42 +0000)
committerZeev Suraski <zeev@php.net>
Tue, 17 Sep 2002 12:42:11 +0000 (12:42 +0000)
Zend/zend.c
Zend/zend.h

index e420d1a7dfb22ea44f7e3d13f53f8a72d3be17de..3b858317709df061238d34cfaa933987e8630f89 100644 (file)
@@ -497,6 +497,21 @@ int zend_startup(zend_utility_functions *utility_functions, char **extensions, i
 }
 
 
+#ifdef ZTS
+/* Unlink the global (r/o) copies of the class, function and constant tables,
+ * and use a fresh r/w copy for the startup thread
+ */
+void zend_post_startup(TSRMLS_D)
+{
+       zend_compiler_globals *compiler_globals = ts_resource(compiler_globals_id);
+
+       compiler_globals_ctor(compiler_globals, tsrm_ls);
+       zend_startup_constants(TSRMLS_C);
+       zend_copy_constants(EG(zend_constants), global_constants_table);
+}
+#endif
+
+
 void zend_shutdown(TSRMLS_D)
 {
 #ifdef ZEND_WIN32
index 393203d7f332421685095f94a26f7c9426bd3ee9..ed1beb06374e4cf822346544e65ec688e9371d77 100644 (file)
@@ -394,6 +394,10 @@ typedef int (*zend_write_func_t)(const char *str, uint str_length);
 int zend_startup(zend_utility_functions *utility_functions, char **extensions, int start_builtin_functions);
 void zend_shutdown(TSRMLS_D);
 
+#ifdef ZTS
+void zend_post_startup(TSRMLS_D);
+#endif
+
 void zend_set_utility_values(zend_utility_values *utility_values);
 
 BEGIN_EXTERN_C()