]> granicus.if.org Git - php/commit
Fixed bug #68583 Crash in timeout thread
authorAnatol Belski <ab@php.net>
Fri, 12 Dec 2014 09:43:31 +0000 (10:43 +0100)
committerAnatol Belski <ab@php.net>
Fri, 12 Dec 2014 09:43:31 +0000 (10:43 +0100)
commit3affc0e8a2167fd5e31cf120f691f52d474e5f89
tree5c56fae58c0e154226fe28b22ac5c3e79935d088
parentc5f7dcd1dc306466de938fc9b9e76dda2a300196
Fixed bug #68583 Crash in timeout thread

This replaces the GUI element used for execution timeout handling
on Windows. Instead a timer queue technique is used, which is indeed
a thread pool. A timer queue timer is a lightweight object handled
but that thread pool and the timer thread spends most of the time
sleeping and waiting for an alert.

Please note also that this introduces neither binary nor source
breach. The custom timeout thread functions are deleted, however
they was not exported throug DLL, so couldn't be used by any
external code. As well they couldn't be used anywhere in the core
except in executor api, because those custom timeout thread
functions they used to operate on static variables which would
be overwritten (and that would blow).

So instead a relatively modern technique is used for the timeout
handling. It's still not perfect because the executor still has to
check EX(timed_out). This can be a topic for an improvement in
master. But brobably can be tricky as currently it seems to be not
possible to signal an individual thread. Also note another issue
that static variables aren't thread safe, but the current timer
implementation is.
NEWS
Zend/zend.c
Zend/zend_execute.h
Zend/zend_execute_API.c