mirror of
https://gitee.com/hyperf/hyperf.git
synced 2024-12-03 20:27:59 +08:00
parentId receive a coroutine id parameter
This commit is contained in:
parent
df0500b434
commit
1847f6bed0
@ -46,9 +46,13 @@ class Coroutine
|
||||
*
|
||||
* @see https://github.com/swoole/swoole-src/pull/2669/files#diff-3bdf726b0ac53be7e274b60d59e6ec80R940
|
||||
*/
|
||||
public static function parentId(): ?int
|
||||
public static function parentId(?int $coroutineId = null): ?int
|
||||
{
|
||||
$cid = SwooleCoroutine::getPcid();
|
||||
if ($coroutineId) {
|
||||
$cid = SwooleCoroutine::getPcid($coroutineId);
|
||||
} else {
|
||||
$cid = SwooleCoroutine::getPcid();
|
||||
}
|
||||
if ($cid === false) {
|
||||
return null;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user