Skip to content

Commit 83b12d5

Browse files
committed
Merge branch 'PHP-7.4'
* PHP-7.4: Prevent race condition in opcache_reset()
2 parents 1e10c06 + e2f8d90 commit 83b12d5

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
@@ -813,7 +813,10 @@ static ZEND_FUNCTION(opcache_reset)
813813
RETURN_FALSE;
814814
}
815815

816+
/* exclusive lock */
817+
zend_shared_alloc_lock();
816818
zend_accel_schedule_restart(ACCEL_RESTART_USER);
819+
zend_shared_alloc_unlock();
817820
RETURN_TRUE;
818821
}
819822

0 commit comments

Comments
 (0)