Skip to content

Commit 354a76b

Browse files
committed
Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2: Prevent race condition in opcache_reset()
2 parents db8ef71 + a8a019d commit 354a76b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

ext/opcache/zend_accelerator_module.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -766,7 +766,10 @@ static ZEND_FUNCTION(opcache_reset)
766766
RETURN_FALSE;
767767
}
768768

769+
/* exclusive lock */
770+
zend_shared_alloc_lock();
769771
zend_accel_schedule_restart(ACCEL_RESTART_USER);
772+
zend_shared_alloc_unlock();
770773
RETURN_TRUE;
771774
}
772775

0 commit comments

Comments
 (0)