Hi!
some time ago (half year or so) I submited this bug ...
I cleaned the patch (at last ;)) - it is in attached file.
It applies to php-4.2.3 and also to php-4.3.0RC3 (with offset warnings
but works ok).
Please someone add it to main version or give me CVS account so I could
do it by myself.
Regards,
Wojtek
diff -urN php-4.2.3/Zend/zend_execute.c php-4.2.3-TO/Zend/zend_execute.c
--- php-4.2.3/Zend/zend_execute.c Sun Jan 6 16:21:09 2002
+++ php-4.2.3-TO/Zend/zend_execute.c Wed Dec 18 08:51:55 2002
@@ -1047,7 +1047,7 @@
}
while (1) {
-#ifdef ZEND_WIN32
+#if defined(ZEND_WIN32) || defined(ZTS)
if (EG(timed_out)) {
zend_timeout(0);
}
diff -urN php-4.2.3/Zend/zend_execute_API.c php-4.2.3-TO/Zend/zend_execute_API.c
--- php-4.2.3/Zend/zend_execute_API.c Sun Jan 6 16:21:09 2002
+++ php-4.2.3-TO/Zend/zend_execute_API.c Wed Dec 18 08:57:33 2002
@@ -152,7 +152,7 @@
EG(orig_error_reporting) = EG(error_reporting);
EG(full_tables_cleanup) = 0;
-#ifdef ZEND_WIN32
+#if defined(ZEND_WIN32) || defined(ZTS)
EG(timed_out) = 0;
#endif
}
@@ -667,6 +667,14 @@
EG(timeout_seconds), EG(timeout_seconds) == 1 ? "" : "s");
}
+#ifdef ZTS
+static void zend_timeout_ZTS(int dummy)
+{
+ TSRMLS_FETCH();
+
+ EG(timed_out)=1;
+}
+#endif
#ifdef ZEND_WIN32
static LRESULT CALLBACK zend_timeout_WndProc(HWND hWnd, UINT message, WPARAM wParam,
LPARAM lParam)
@@ -786,7 +794,11 @@
t_r.it_value.tv_usec = t_r.it_interval.tv_sec =
t_r.it_interval.tv_usec = 0;
setitimer(ITIMER_PROF, &t_r, NULL);
+#ifdef ZTS
+ signal(SIGPROF, zend_timeout_ZTS);
+#else
signal(SIGPROF, zend_timeout);
+#endif
sigemptyset(&sigset);
sigaddset(&sigset, SIGPROF);
sigprocmask(SIG_UNBLOCK, &sigset, NULL);
diff -urN php-4.2.3/Zend/zend_globals.h php-4.2.3-TO/Zend/zend_globals.h
--- php-4.2.3/Zend/zend_globals.h Thu Aug 15 02:25:57 2002
+++ php-4.2.3-TO/Zend/zend_globals.h Wed Dec 18 08:58:27 2002
@@ -164,7 +164,7 @@
/* for extended information support */
zend_bool no_extensions;
-#ifdef ZEND_WIN32
+#if defined(ZEND_WIN32) || defined (ZTS)
zend_bool timed_out;
#endif
--
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, visit: http://www.php.net/unsub.php