Skip to content

Commit e720fb7

Browse files
committed
Merge branch 'PHP-7.4'
* PHP-7.4: Fix ZTS issue regarding new Windows CTRL handling API
2 parents 2ab1c03 + 637d867 commit e720fb7

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

sapi/cli/tests/sapi_windows_set_ctrl_handler.phpt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ include "skipinf.inc";
88
if (strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN')
99
die("skip this test is for Windows platforms only");
1010
?>
11-
--XFAIL--
12-
Fails on AppVeyor
1311
--FILE--
1412
<?php
1513

win32/signal.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,10 @@
2121

2222
#include "win32/console.h"
2323

24-
ZEND_TLS zval ctrl_handler;
25-
ZEND_TLS DWORD ctrl_evt = (DWORD)-1;
26-
ZEND_TLS zend_bool *vm_interrupt_flag = NULL;
24+
/* true globals; only used from main thread and from kernel callback */
25+
static zval ctrl_handler;
26+
static DWORD ctrl_evt = (DWORD)-1;
27+
static zend_bool *vm_interrupt_flag = NULL;
2728

2829
static void (*orig_interrupt_function)(zend_execute_data *execute_data);
2930

@@ -78,7 +79,7 @@ static BOOL WINAPI php_win32_signal_system_ctrl_handler(DWORD evt)
7879
return FALSE;
7980
}
8081

81-
(void)InterlockedExchange((LONG*)vm_interrupt_flag, 1);
82+
(void)InterlockedExchange8(vm_interrupt_flag, 1);
8283

8384
ctrl_evt = evt;
8485

0 commit comments

Comments
 (0)