PHP Manual
Function Reference
Other Basic Extensions
Swoole
Introduction
Installing/Configuring
Predefined Constants
Swoole Functions
Swoole\Async
Swoole\Atomic
Swoole\Buffer
Swoole\Channel
Swoole\Client
Swoole\Connection\Iterator
Swoole\Coroutine
Swoole\Event
Swoole\Exception
Swoole\Http\Client
Swoole\Http\Request
Swoole\Http\Response
Swoole\Http\Server
Swoole\Lock
Swoole\Mmap
Swoole\MySQL
Swoole\MySQL\Exception
Swoole\Process
Swoole\Redis\Server
Swoole\Serialize
Swoole\Server
Swoole\Table
Swoole\Timer
Swoole\WebSocket\Frame
Swoole\WebSocket\Server
Swoole\Http\Server::start
Swoole\Lock::__construct
Swoole
PHP Manual
The Swoole\Lock class
Introduction
Class synopsis
Swoole\Lock
class
Swoole\Lock
{
/* Methods */
public
void
__destruct
()
public
void
lock
()
public
void
lock_read
()
public
void
trylock
()
public
void
trylock_read
()
public
void
unlock
()
}
Table of Contents
Swoole\Lock::__construct
— Construct a memory lock.
Swoole\Lock::__destruct
— Destroy a Swoole memory lock.
Swoole\Lock::lock
— Try to acquire the lock. It will block if the lock is not available.
Swoole\Lock::lock_read
— Lock a read-write lock for reading.
Swoole\Lock::trylock
— Try to acquire the lock and return straight away even the lock is not available.
Swoole\Lock::trylock_read
— Try to lock a read-write lock for reading and return straight away even the lock is not available.
Swoole\Lock::unlock
— Release the lock.