Skip to content

Commit e2f8d90

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

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
@@ -792,7 +792,10 @@ static ZEND_FUNCTION(opcache_reset)
792792
RETURN_FALSE;
793793
}
794794

795+
/* exclusive lock */
796+
zend_shared_alloc_lock();
795797
zend_accel_schedule_restart(ACCEL_RESTART_USER);
798+
zend_shared_alloc_unlock();
796799
RETURN_TRUE;
797800
}
798801

0 commit comments

Comments
 (0)