« Swoole\Coroutine\Lock::__construct
Swoole\Coroutine\Lock::trylock »

Swoole\Coroutine\Lock::lock

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

Swoole\Coroutine\Lock::lock — Acquire the lock, blocking if necessary

説明

public function 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.

関連キーワード:
lock   Swoole   Coroutine   Lock   coroutine   Acquire   blocking   necessary   construct   trylock   information   available   executing   operation   already   held   current   actively   yield   control   suspended   state   holding   calls   unlock
関連する関数・ページ:
swoole-coroutine-lock.construct   swoole-coroutine-lock.trylock   class.swoole-coroutine-lock   swoole-lock.lock   swoole-coroutine-lock.unlock   class.swoole-lock