Results of 1 - 2 of about 2 for waitGroup (0.001 sec.)
- The Swoole\Coroutine\Lock class 11228
- « Swoole\Coroutine::suspend Swoole\Coroutine\Lock::__construct » PHP Manual Swoole The Swoole\Coroutine\Lock class 検索 The Swoole\Coroutine\Lock class (No version information available, might only be in Git) はじめに Swoole 6.0.1 introduce
... ylock (): bool public function unlock (): bool } 例 例1 Basic usage <?php use Swoole\Coroutine\Lock ; use Swoole\Coroutine\WaitGroup ; use function Swoole\Coroutine\go ; use function Swoole\Coroutine\run ; $lock = new Lock (); $waitGroup = new WaitGroup ( ... ); run (function() use ( $lock , $waitGroup ) { go (function() use ( $lock , $waitGroup ) { $waitGroup -> add (); $lock -> lock (); sleep ( 1 ); $lock -> unlock (); $ ... waitGroup -> done (); }); go (function() use ( $lock , $waitGroup ) { $waitGroup -> add (); $lock -> lock (); // Wait for the holding coroutine to unlock sleep ( 1 ); $lock -> unlock (); $ ...
-
https://man.mtool.work/php/8.3/class.swoole-coroutine-lock.html
- The Swoole\Coroutine\Lock class 7485
- « Swoole\Coroutine::suspend Swoole\Coroutine\Lock::__construct » PHP Manual Swoole The Swoole\Coroutine\Lock class 検索 The Swoole\Coroutine\Lock class (No version information available, might only be in Git) はじめに Swoole 6.0.1 introduce
... ylock (): bool public function unlock (): bool } 例 例1 Basic usage <?php use Swoole\Coroutine\Lock ; use Swoole\Coroutine\WaitGroup ; use function Swoole\Coroutine\go ; use function Swoole\Coroutine\run ; $lock = new Lock (); $waitGroup = new WaitGroup ( ... ); run (function() use ( $lock , $waitGroup ) { go (function() use ( $lock , $waitGroup ) { $waitGroup -> add (); $lock -> lock (); sleep ( 1 ); $lock -> unlock (); $ ... waitGroup -> done (); }); go (function() use ( $lock , $waitGroup ) { $waitGroup -> add (); $lock -> lock (); // Wait for the holding coroutine to unlock sleep ( 1 ); $lock -> unlock (); $ ...
-
https://man.mtool.work/php/8.3/class.swoole-coroutine-lock.html
PREV
1
NEXT