php8.5
Home/ Manual/ coroutine / lock/ Swoole\Coroutine\Lock::unlock

Swoole\Coroutine\Lock::unlock

PHP function Edit on GitHub ✎

Release the lock

Description

Swoole\Coroutine\Lock::unlock(): bool

Unlock Behavior

  1. With io_uring futex: the system will precisely wake up one coroutine in the waiting queue.
  2. Without io_uring futex: waiting coroutines need to wait for their backoff time to end and compete to reacquire the lock.

Parameters Parameters

Return Values

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

Source: reference/swoole/swoole/coroutine/lock/unlock.xml · from the official PHP manual (php/doc-en)