]> granicus.if.org Git - php/commitdiff
On Windows I guess there is no point starting the timeout thread until
authorRasmus Lerdorf <rasmus@php.net>
Wed, 19 Mar 2008 15:30:49 +0000 (15:30 +0000)
committerRasmus Lerdorf <rasmus@php.net>
Wed, 19 Mar 2008 15:30:49 +0000 (15:30 +0000)
we actually have a timeout value.

Zend/zend_execute_API.c

index 2b939e4147f52496dd5e630fc33a643a45eca29a..0666762b3b0a5b743dfb200721cf5bee53949d97 100644 (file)
@@ -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
        {