diff options
author | Christoph M. Becker <cmbecker69@gmx.de> | 2019-06-01 09:08:51 +0200 |
---|---|---|
committer | Christoph M. Becker <cmbecker69@gmx.de> | 2019-06-01 09:35:47 +0200 |
commit | 637d8677b3b5f523265ae4c9adc27344c1c70ed0 (patch) | |
tree | c7397da09e35298effb11778ca101a2d881a25b8 /win32/signal.c | |
parent | d669d55fe1aa5b94231fd2923748fd7bd26b1eb5 (diff) | |
download | php-git-637d8677b3b5f523265ae4c9adc27344c1c70ed0.tar.gz |
Fix ZTS issue regarding new Windows CTRL handling API
php_win32_signal_system_ctrl_handler() is called from a kernel thread,
so the former initialization of `vm_interrupt_flag` has no effect,
since it is defined as thread-local. This is, however, not necessary,
since the CTRL signal handling is supposed to work only for the main
thread anyway. We therefore change `vm_interrupt_flag` and the related
variables to true globals.
This also allows us to unmark the respective test case as XFAIL.
Furthermore, `vm_interrupt_flag` is declared as `zend_bool *`, so we
better treat it such.
Diffstat (limited to 'win32/signal.c')
-rw-r--r-- | win32/signal.c | 9 |
1 files changed, 5 insertions, 4 deletions
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; |