1
0
mirror of https://github.com/danog/parallel.git synced 2024-11-26 20:34:40 +01:00

Exit thread immediately if killed while loading autoloader

This commit is contained in:
Aaron Piotrowski 2017-07-19 00:14:16 -05:00
parent 58ce0df037
commit f716981c95
No known key found for this signature in database
GPG Key ID: ADD1EF783EDE9EEB

View File

@ -82,6 +82,10 @@ class Thread extends \Thread {
// At this point, the thread environment has been prepared so begin using the thread.
if ($this->killed) {
return; // Thread killed while requiring autoloader, simply exit.
}
Loop::run(function () {
$watcher = Loop::repeat(self::KILL_CHECK_FREQUENCY, function () {
if ($this->killed) {