diff options
author | Anatol Belski <ab@php.net> | 2014-09-24 20:44:37 +0200 |
---|---|---|
committer | Anatol Belski <ab@php.net> | 2014-09-24 20:44:37 +0200 |
commit | 70077d84e9817293f59454dc97d6aa3be89f9c7a (patch) | |
tree | 878e0decde0f6aef413d53b1ecf5430d273ef601 | |
parent | aa8c424e0f4cc4d725d2437f07ace2390a90ff2e (diff) | |
download | php-git-70077d84e9817293f59454dc97d6aa3be89f9c7a.tar.gz |
check che right thing to prevent the crash in the timeout thread
Though this seems to be a dead end, the lines CG(timed_out) = 0; looks
like will never be executed in the TS build. Or at least it'll be executed
by luck when the scheduler has decided to let the master thread run for
longer. NTS should be fine with that however.
-rw-r--r-- | Zend/zend_execute_API.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index f59a10179b..9c849598b1 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -1178,12 +1178,12 @@ static LRESULT CALLBACK zend_timeout_WndProc(HWND hWnd, UINT message, WPARAM wPa KillTimer(timeout_window, wParam); } else { #ifdef ZTS - void ***tsrm_ls; + void *tsrm_ls_cache; #endif SetTimer(timeout_window, wParam, lParam*1000, NULL); #ifdef ZTS - tsrm_ls = ts_resource_ex(0, &wParam); - if (!tsrm_ls) { + tsrm_ls_cache = get_tsrm_ls_cache(); + if (!tsrm_ls_cache) { /* shouldn't normally happen */ break; } @@ -1197,10 +1197,10 @@ static LRESULT CALLBACK zend_timeout_WndProc(HWND hWnd, UINT message, WPARAM wPa break; case WM_TIMER: { #ifdef ZTS - void ***tsrm_ls; + void *tsrm_ls_cache; - tsrm_ls = ts_resource_ex(0, &wParam); - if (!tsrm_ls) { + tsrm_ls_cache = get_tsrm_ls_cache(); + if (!tsrm_ls_cache) { /* Thread died before receiving its timeout? */ break; } @@ -1280,8 +1280,6 @@ void zend_shutdown_timeout_thread(void) /* {{{ */ void zend_set_timeout(zend_long seconds, int reset_signals) /* {{{ */ { - TSRMLS_FETCH(); - EG(timeout_seconds) = seconds; #ifdef ZEND_WIN32 |