summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2019-05-21 00:08:03 +0300
committerDmitry Stogov <dmitry@zend.com>2019-05-21 00:08:03 +0300
commit354a76bb800bad8efe1215945ee9fd776970a15d (patch)
tree8e14d8727764228770b7cc41dae2a3da3922b62c
parentdb8ef71353cd5770860e37afd94001926ba575a0 (diff)
parenta8a019d68a605dd2b699174dd7f55d6e8bbaeee6 (diff)
downloadphp-git-354a76bb800bad8efe1215945ee9fd776970a15d.tar.gz
Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2: Prevent race condition in opcache_reset()
-rw-r--r--ext/opcache/zend_accelerator_module.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/ext/opcache/zend_accelerator_module.c b/ext/opcache/zend_accelerator_module.c
index 5b43a55202..23585d0d46 100644
--- a/ext/opcache/zend_accelerator_module.c
+++ b/ext/opcache/zend_accelerator_module.c
@@ -766,7 +766,10 @@ static ZEND_FUNCTION(opcache_reset)
RETURN_FALSE;
}
+ /* exclusive lock */
+ zend_shared_alloc_lock();
zend_accel_schedule_restart(ACCEL_RESTART_USER);
+ zend_shared_alloc_unlock();
RETURN_TRUE;
}