Skip to content

Commit a8a019d

Browse files
committed
Prevent race condition in opcache_reset()
1 parent 64ec9f4 commit a8a019d

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
@@ -768,7 +768,10 @@ static ZEND_FUNCTION(opcache_reset)
768768
RETURN_FALSE;
769769
}
770770

771+
/* exclusive lock */
772+
zend_shared_alloc_lock();
771773
zend_accel_schedule_restart(ACCEL_RESTART_USER);
774+
zend_shared_alloc_unlock();
772775
RETURN_TRUE;
773776
}
774777

0 commit comments

Comments
 (0)