summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2019-05-21 00:08:12 +0300
committerDmitry Stogov <dmitry@zend.com>2019-05-21 00:08:12 +0300
commite2f8d906cfd13a9e63efc6fac119f70a813b1ce4 (patch)
tree0695d399b85538a179bd4307ee5783a8d116d7f8
parentf53b9939fe4f66e1a539a42d607fefbe45be6239 (diff)
parent354a76bb800bad8efe1215945ee9fd776970a15d (diff)
downloadphp-git-e2f8d906cfd13a9e63efc6fac119f70a813b1ce4.tar.gz
Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3: 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 fd35098c9e..35eaaca650 100644
--- a/ext/opcache/zend_accelerator_module.c
+++ b/ext/opcache/zend_accelerator_module.c
@@ -792,7 +792,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;
}