git.graph-it.com
/
graphit
/
concurrent.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
b3b1eba
)
Umgehe Fehler in PHP 8.2.9 (https://github.com/php/php-src/pull/11863)
master
v0.1.2
author
Sebastian Brix
<sebastian.brix@graph-it.com>
Fri, 25 Aug 2023 08:50:22 +0000
(10:50 +0200)
committer
Sebastian Brix
<sebastian.brix@graph-it.com>
Fri, 25 Aug 2023 08:50:22 +0000
(10:50 +0200)
src/Thread.php
patch
|
blob
|
history
diff --git
a/src/Thread.php
b/src/Thread.php
index deb20ade246410566f953cf1a4d7644864d2d95c..8db0855c04fa7e8e90f762e02647165f77f56643 100644
(file)
--- a/
src/Thread.php
+++ b/
src/Thread.php
@@
-44,7
+44,7
@@
abstract class Thread
Thread::$current->pid = posix_getpid();
pcntl_signal(SIGTERM, function() { Thread::$current->termHandler(); });
Thread::$current->pid = posix_getpid();
pcntl_signal(SIGTERM, function() { Thread::$current->termHandler(); });
- pcntl_signal(SIGCHLD, function(
) { Thread::$current->chldHandler(
); });
+ pcntl_signal(SIGCHLD, function(
$signum, $siginfo) { Thread::$current->chldHandler($siginfo
); });
}
/**
}
/**
@@
-58,8
+58,21
@@
abstract class Thread
/**
* @return void
*/
/**
* @return void
*/
- protected function chldHandler()
+ protected function chldHandler(
$siginfo
)
{
{
+ if (phpversion() == '8.2.9'){
+ if (is_array($siginfo) && isset($siginfo['pid']) && is_int($siginfo['pid'])) {
+ $childpid = $siginfo['pid'];
+
+ if (isset($this->children[$childpid])) {
+ $child = $this->children[$childpid];
+ $child->isRunning();
+
+ unset($this->children[$childpid]);
+ }
+ }
+ }
+
while (($childpid = pcntl_waitpid(-1, $status, WNOHANG)) > 0) {
if (isset($this->children[$childpid])) {
$child = $this->children[$childpid];
while (($childpid = pcntl_waitpid(-1, $status, WNOHANG)) > 0) {
if (isset($this->children[$childpid])) {
$child = $this->children[$childpid];