public static function create(callable $cb)
    {
        if (!ServerUtil::coroutineIsEnabled()) {
            return false;
        }

        $tid = self::tid();

        return SwCoroutine::create(function () use ($cb, $tid) {
            $id = SwCoroutine::getuid();

            self::$idMap[$id] = $tid;

            PhpHelper::call($cb);
        });
    }
public static function create(callable $cb)
    {
        if (!ServerUtil::coroutineIsEnabled()) {
            return false;
        }

        $tid = self::tid();

        return SwCoroutine::create(function () use ($cb, $tid) {
            $id = SwCoroutine::getuid();

            self::$idMap[$id] = $tid;

            PhpHelper::call($cb);
        });
    }
public static function create ( callable $ cb ) { if ( ! ServerUtil :: coroutineIsEnabled ( ) ) { return false ; } $ tid = self :: tid ( ) ; return SwCoroutine :: create ( function ( ) use ( $ cb , $ tid ) { $ id = SwCoroutine :: getuid ( ) ; self :: $ idMap [ $ id ] = $ tid ; PhpHelper :: call ( $ cb ) ; } ) ; }
create a child coroutine
@param callable $cb
@return bool|int success return CID, fail return false.
create a child coroutine