Skip to content

Commit

Permalink
check che right thing to prevent the crash in the timeout thread
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
weltling committed Sep 24, 2014
1 parent aa8c424 commit 70077d8
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions Zend/zend_execute_API.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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;
}
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 70077d8

Please sign in to comment.