From: Sebastian Brix Date: Mon, 20 Mar 2023 16:10:38 +0000 (+0100) Subject: Use closure to access protected method. X-Git-Tag: v0.1.1 X-Git-Url: http://git.graph-it.com/?a=commitdiff_plain;h=b3b1eba8f80fa2890513f9f7b2ffb45aa7770ea8;p=graphit%2Fconcurrent.git Use closure to access protected method. --- diff --git a/src/Thread.php b/src/Thread.php index 0a0a9d6..deb20ad 100644 --- a/src/Thread.php +++ b/src/Thread.php @@ -43,8 +43,8 @@ abstract class Thread Thread::$current = $current; Thread::$current->pid = posix_getpid(); - pcntl_signal(SIGTERM, array(Thread::$current, 'termHandler')); - pcntl_signal(SIGCHLD, array(Thread::$current, 'chldHandler')); + pcntl_signal(SIGTERM, function() { Thread::$current->termHandler(); }); + pcntl_signal(SIGCHLD, function() { Thread::$current->chldHandler(); }); } /**