mirror of
https://github.com/php/php-src.git
synced 2024-12-02 06:13:40 +08:00
Start timiout thread on Windows only if necessary
This commit is contained in:
parent
768185e58f
commit
449e7d18a2
@ -1521,6 +1521,9 @@ void zend_set_timeout(long seconds)
|
||||
TSRMLS_FETCH();
|
||||
|
||||
EG(timeout_seconds) = seconds;
|
||||
if(!seconds) {
|
||||
return;
|
||||
}
|
||||
#ifdef ZEND_WIN32
|
||||
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
|
||||
@ -1559,7 +1562,9 @@ void zend_set_timeout(long seconds)
|
||||
void zend_unset_timeout(TSRMLS_D)
|
||||
{
|
||||
#ifdef ZEND_WIN32
|
||||
PostThreadMessage(timeout_thread_id, WM_UNREGISTER_ZEND_TIMEOUT, (WPARAM) GetCurrentThreadId(), (LPARAM) 0);
|
||||
if(timeout_thread_initialized) {
|
||||
PostThreadMessage(timeout_thread_id, WM_UNREGISTER_ZEND_TIMEOUT, (WPARAM) GetCurrentThreadId(), (LPARAM) 0);
|
||||
}
|
||||
#else
|
||||
# ifdef HAVE_SETITIMER
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user