summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2017-10-18 18:26:30 +0300
committerDmitry Stogov <dmitry@zend.com>2017-10-18 18:26:30 +0300
commite87e62cc6f9dc490c1738fe9af5bb9bde995fcec (patch)
tree7733ca43f516329136171d6153335262e1a23732
parentb4903aef16ec215f2095ff0a3615524656401660 (diff)
downloadphp-git-e87e62cc6f9dc490c1738fe9af5bb9bde995fcec.tar.gz
Moved ZCG(function_table) back into accel_acrivate. It should be unique per thread.
-rw-r--r--ext/opcache/ZendAccelerator.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/ext/opcache/ZendAccelerator.c b/ext/opcache/ZendAccelerator.c
index 400db342f2..cf1e1ce7d3 100644
--- a/ext/opcache/ZendAccelerator.c
+++ b/ext/opcache/ZendAccelerator.c
@@ -2140,6 +2140,11 @@ static void accel_activate(void)
return;
}
+ if (!ZCG(function_table).nTableSize) {
+ zend_hash_init(&ZCG(function_table), zend_hash_num_elements(CG(function_table)), NULL, ZEND_FUNCTION_DTOR, 1);
+ zend_accel_copy_internal_functions();
+ }
+
/* PHP-5.4 and above return "double", but we use 1 sec precision */
ZCG(auto_globals_mask) = 0;
ZCG(request_time) = (time_t)sapi_get_request_time();
@@ -2628,9 +2633,6 @@ static int accel_post_startup(void)
}
}
- zend_hash_init(&ZCG(function_table), zend_hash_num_elements(CG(function_table)), NULL, ZEND_FUNCTION_DTOR, 1);
- zend_accel_copy_internal_functions();
-
/********************************************/
/* End of non-SHM dependent initializations */
/********************************************/