]> granicus.if.org Git - php/commitdiff
Prevent race condition in opcache_reset()
authorDmitry Stogov <dmitry@zend.com>
Mon, 20 May 2019 21:07:17 +0000 (00:07 +0300)
committerDmitry Stogov <dmitry@zend.com>
Mon, 20 May 2019 21:07:17 +0000 (00:07 +0300)
ext/opcache/zend_accelerator_module.c

index 16fe80c9b40acf901af3c66182608eb71f5cbd7f..4d4de77993cf792c5d9e715385ec7e529e6d8b06 100644 (file)
@@ -768,7 +768,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;
 }