From da0ff5adbc2126043a255687ed0eece691064237 Mon Sep 17 00:00:00 2001 From: Demin Yin Date: Mon, 18 Dec 2023 22:08:33 -0800 Subject: [PATCH] update line #s Signed-off-by: Demin Yin --- examples/csp/deadlocks/server-shutdown.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/csp/deadlocks/server-shutdown.php b/examples/csp/deadlocks/server-shutdown.php index d9c8ed4..4c03eeb 100755 --- a/examples/csp/deadlocks/server-shutdown.php +++ b/examples/csp/deadlocks/server-shutdown.php @@ -10,7 +10,7 @@ * docker run --rm -v $(pwd):/var/www -ti phpswoole/swoole php ./examples/csp/deadlocks/server-shutdown.php * When the script is executed, it will print out the following error message: * [FATAL ERROR]: all coroutines (count: 1) are asleep - deadlock! - * To fix the deadlock, uncomment line 41 and line 32, then rerun the script. + * To fix the deadlock, uncomment line 40 and line 31, then rerun the script. */ use Swoole\Coroutine; @@ -27,7 +27,7 @@ $cid = Coroutine::create(function () { while (true) { // @phpstan-ignore while.alwaysTrue if (Coroutine::isCanceled()) { - // The deadlock can be resolved by uncommenting line 41 and line 32. + // The deadlock can be resolved by uncommenting line 40 and line 31. // break; #2: Quit the infinite loop after the coroutine is canceled. } Coroutine::sleep(0.01); @@ -36,7 +36,7 @@ // Shutdown the server after 2 seconds. Timer::after(2_000, function () use ($server, $cid) { // @phpstan-ignore closure.unusedUse - // The deadlock can be resolved by uncommenting line 41 and line 32. + // The deadlock can be resolved by uncommenting line 40 and line 31. // Coroutine::cancel($cid); #1: Cancel the coroutine before shutting down the server. echo 'The server is shutting down.', PHP_EOL;