Commit 29c57a4e85d for php
commit 29c57a4e85dc87a954b7e88cec237b85c1bc66ce
Merge: 90c0484e615 06f39977cbe
Author: Arnaud Le Blanc <arnaud.lb@gmail.com>
Date: Fri Nov 27 12:21:53 2026 +0100
Merge branch 'PHP-8.5' into PHP-8.6
* PHP-8.5:
Admit NTS requests to OPcache SHM only in RINIT (#25509)
diff --cc ext/opcache/ZendAccelerator.c
index daa5e07e892,76f225110bb..d9513cdf54d
--- a/ext/opcache/ZendAccelerator.c
+++ b/ext/opcache/ZendAccelerator.c
@@@ -337,21 -337,14 +337,14 @@@ static inline bool accel_restart_is_act
return LOCKVAL(restart_in) != 0;
#endif
}
- return 0;
+ return false;
}
- #if defined(ZTS) && !defined(ZEND_WIN32)
- /* fcntl() locks belong to the process, so under ZTS they cannot tell which threads
- * use SHM (GH-8739). The threads of this process that use SHM are counted here, and
- * the process holds the reader lock (byte 1) whenever the count is not zero, so other
- * processes still see it. A restart needs a zero count and a write lock on byte 1.
- * The 0 <-> 1 transitions and the restart are serialized by accel_zts_readers_mutex,
- * other changes of the count are lock-free. */
- static MUTEX_T accel_zts_readers_mutex = NULL;
- static zend_atomic_int accel_zts_readers;
- static time_t accel_zts_next_warning;
-
- static bool accel_zts_lock_reader_byte(int cmd, int type)
+ #ifndef ZEND_WIN32
+ /* A request becomes a reader of SHM only in RINIT, holding the reader lock (byte 1)
+ * until accel_post_deactivate(). A restart takes the write lock on byte 1, so it waits
+ * for the readers, and requests wait in RINIT while the restart runs. */
+ static bool accel_lock_reader_byte(int cmd, int type)
{
struct flock lock;