1
0
mirror of https://github.com/php/php-src.git synced 2026-04-24 00:18:23 +02:00

On Windows I guess there is no point starting the timeout thread until

we actually have a timeout value.
This commit is contained in:
Rasmus Lerdorf
2008-03-19 15:30:49 +00:00
parent d2f23dbe64
commit ea790cef01
+4 -1
View 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
{