summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sapi/cli/tests/sapi_windows_set_ctrl_handler.phpt2
-rw-r--r--win32/signal.c9
2 files changed, 5 insertions, 6 deletions
diff --git a/sapi/cli/tests/sapi_windows_set_ctrl_handler.phpt b/sapi/cli/tests/sapi_windows_set_ctrl_handler.phpt
index 083ed8fd0c..a5cb3ef03e 100644
--- a/sapi/cli/tests/sapi_windows_set_ctrl_handler.phpt
+++ b/sapi/cli/tests/sapi_windows_set_ctrl_handler.phpt
@@ -8,8 +8,6 @@ include "skipinf.inc";
if (strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN')
die("skip this test is for Windows platforms only");
?>
---XFAIL--
-Fails on AppVeyor
--FILE--
<?php
diff --git a/win32/signal.c b/win32/signal.c
index 586e125eb0..bdfd7033f3 100644
--- a/win32/signal.c
+++ b/win32/signal.c
@@ -21,9 +21,10 @@
#include "win32/console.h"
-ZEND_TLS zval ctrl_handler;
-ZEND_TLS DWORD ctrl_evt = (DWORD)-1;
-ZEND_TLS zend_bool *vm_interrupt_flag = NULL;
+/* true globals; only used from main thread and from kernel callback */
+static zval ctrl_handler;
+static DWORD ctrl_evt = (DWORD)-1;
+static zend_bool *vm_interrupt_flag = NULL;
static void (*orig_interrupt_function)(zend_execute_data *execute_data);
@@ -78,7 +79,7 @@ static BOOL WINAPI php_win32_signal_system_ctrl_handler(DWORD evt)
return FALSE;
}
- (void)InterlockedExchange((LONG*)vm_interrupt_flag, 1);
+ (void)InterlockedExchange8(vm_interrupt_flag, 1);
ctrl_evt = evt;