From b3b1eba8f80fa2890513f9f7b2ffb45aa7770ea8 Mon Sep 17 00:00:00 2001 From: Sebastian Brix Date: Mon, 20 Mar 2023 17:10:38 +0100 Subject: [PATCH] Use closure to access protected method. --- src/Thread.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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(); }); } /** -- 2.34.1