mirror of
https://gitee.com/hyperf/hyperf.git
synced 2024-12-04 20:58:13 +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
|
* @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
|
||||||
{
|
{
|
||||||
|
if ($coroutineId) {
|
||||||
|
$cid = SwooleCoroutine::getPcid($coroutineId);
|
||||||
|
} else {
|
||||||
$cid = SwooleCoroutine::getPcid();
|
$cid = SwooleCoroutine::getPcid();
|
||||||
|
}
|
||||||
if ($cid === false) {
|
if ($cid === false) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user