From: Rasmus Lerdorf Date: Wed, 7 Sep 2011 18:48:17 +0000 (+0000) Subject: Make timeouts work again for shutdown functions. X-Git-Tag: php-5.5.0alpha1~1224 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ca2234d18c89f7e631420e60448d56fa1dec2d9a;p=php Make timeouts work again for shutdown functions. Fixes the faling lang/045 test --- diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index 839621ea6b..2572f85b90 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -1328,6 +1328,13 @@ ZEND_API void zend_timeout(int dummy) /* {{{ */ TSRMLS_FETCH(); if (zend_on_timeout) { + /* + We got here because we got a timeout signal, so we are in a signal handler + at this point. However, we want to be able to timeout any user-supplied + shutdown functions, so pretend we are not in a signal handler while we are + calling these + */ + SIGG(running) = 0; zend_on_timeout(EG(timeout_seconds) TSRMLS_CC); }