From: Rasmus Lerdorf Date: Wed, 19 Mar 2008 15:30:49 +0000 (+0000) Subject: On Windows I guess there is no point starting the timeout thread until X-Git-Tag: BEFORE_NEW_PARAMETER_PARSE~525 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ea790cef01b6551db288935eae08802bc9bdb831;p=php On Windows I guess there is no point starting the timeout thread until we actually have a timeout value. --- diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index 2b939e4147..0666762b3b 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -1534,13 +1534,16 @@ void zend_set_timeout(long seconds, int reset_signals) /* {{{ */ EG(timeout_seconds) = seconds; #ifdef ZEND_WIN32 + if(!seconds) { + return; + } if (timeout_thread_initialized == 0 && InterlockedIncrement(&timeout_thread_initialized) == 1) { /* We start up this process-wide thread here and not in zend_startup(), because if Zend * is initialized inside a DllMain(), you're not supposed to start threads from it. */ zend_init_timeout_thread(); } - if(seconds) PostThreadMessage(timeout_thread_id, WM_REGISTER_ZEND_TIMEOUT, (WPARAM) GetCurrentThreadId(), (LPARAM) seconds); + PostThreadMessage(timeout_thread_id, WM_REGISTER_ZEND_TIMEOUT, (WPARAM) GetCurrentThreadId(), (LPARAM) seconds); #else # ifdef HAVE_SETITIMER {