summaryrefslogtreecommitdiff
path: root/ext/opcache/ZendAccelerator.c
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2016-02-17 13:58:05 +0300
committerDmitry Stogov <dmitry@zend.com>2016-02-17 13:58:05 +0300
commitd2287529396539fd2cba6f449ae9679cac64c3b9 (patch)
treed9c1c5eb26504e6b0db15f39f75c5d1e649d6646 /ext/opcache/ZendAccelerator.c
parent6f6bd8ce531636134efd5f669a4e8373fb2e9e51 (diff)
downloadphp-git-d2287529396539fd2cba6f449ae9679cac64c3b9.tar.gz
Fixed process synchronisation problem, that may cause crashes after opcache restart
Diffstat (limited to 'ext/opcache/ZendAccelerator.c')
-rw-r--r--ext/opcache/ZendAccelerator.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/ext/opcache/ZendAccelerator.c b/ext/opcache/ZendAccelerator.c
index 9e606f0ae5..addfe87ab5 100644
--- a/ext/opcache/ZendAccelerator.c
+++ b/ext/opcache/ZendAccelerator.c
@@ -2278,6 +2278,19 @@ static void zend_accel_fast_shutdown(void)
}
#endif
+int accel_post_deactivate(void)
+{
+ if (!ZCG(enabled) || !accel_startup_ok) {
+ return SUCCESS;
+ }
+
+ zend_shared_alloc_safe_unlock(); /* be sure we didn't leave cache locked */
+ accel_unlock_all();
+ ZCG(counted) = 0;
+
+ return SUCCESS;
+}
+
static void accel_deactivate(void)
{
/* ensure that we restore function_table and class_table
@@ -2294,10 +2307,6 @@ static void accel_deactivate(void)
return;
}
- zend_shared_alloc_safe_unlock(); /* be sure we didn't leave cache locked */
- accel_unlock_all();
- ZCG(counted) = 0;
-
#if !ZEND_DEBUG
if (ZCG(accel_directives).fast_shutdown && is_zend_mm()) {
zend_accel_fast_shutdown();