Swoole\Coroutine\Lock::lock

(No version information available, might only be in Git)

Swoole\Coroutine\Lock::lockAcquire the lock, blocking if necessary

说明

public Swoole\Coroutine\Lock::lock(): bool

When executing the lock operation, if the lock is already held by another coroutine, the current coroutine will actively yield CPU control and enter a suspended state. When the coroutine holding the lock calls unlock(), the waiting coroutine will be awakened and try to acquire the lock again.

参数

此函数没有参数。

返回值

Returns true if the lock was acquired successfully, false otherwise.

添加备注

用户贡献的备注

此页面尚无用户贡献的备注。
To Top