Skip to content

Commit 485c5bb

Browse files
committed
ext/opcache: add code comment and warning on Windows
kill_all_lockers() is not implemented on Windows, thus the code is incomplete and broken. See php#10276 (comment) for the explanation.
1 parent 7369957 commit 485c5bb

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

ext/opcache/ZendAccelerator.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -896,6 +896,10 @@ static inline void kill_all_lockers(struct flock *mem_usage_check)
896896
static inline int accel_is_inactive(void)
897897
{
898898
#ifdef ZEND_WIN32
899+
/* TODO: the Windows-specific code path is broken because
900+
kill_all_lockers() is not implemented on Windows, and thus
901+
hanging workers are never killed and restarted; not ready
902+
for production use! */
899903
if (LOCKVAL(mem_usage) == 0) {
900904
return SUCCESS;
901905
}

ext/opcache/config.w32

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,6 @@ if (PHP_OPCACHE != "no") {
4141

4242
ADD_FLAG('CFLAGS_OPCACHE', "/I " + configure_module_dirname);
4343

44+
WARNING("opcache is known to be broken on Windows");
4445
}
4546

0 commit comments

Comments
 (0)