StaticKeySemaphore
in package
implements
Mutex
uses
ForbidCloning, ForbidSerialization
FinalYes
Table of Contents
Interfaces
- Mutex
- A synchronization primitive that can be used for mutual exclusion across contexts.
Properties
- $key : string
- $semaphore : KeyedSemaphore
Methods
- __construct() : mixed
- __serialize() : never
- __unserialize() : never
- acquire() : Lock
- Acquires a lock on the mutex. A mutex has only a single lock available.
- __clone() : mixed
Properties
$key read-only
private
string
$key
$semaphore read-only
private
KeyedSemaphore
$semaphore
Methods
__construct()
public
__construct(KeyedSemaphore $semaphore, string $key) : mixed
Parameters
- $semaphore : KeyedSemaphore
- $key : string
__serialize()
public
final __serialize() : never
Return values
never__unserialize()
public
final __unserialize(array<string|int, mixed> $data) : never
Parameters
- $data : array<string|int, mixed>
Return values
neveracquire()
Acquires a lock on the mutex. A mutex has only a single lock available.
public
acquire() : Lock
Return values
Lock —Returns with a lock object once a lock is obtained. May fail with a SyncException if an error occurs when attempting to obtain the lock (e.g. a shared memory segment closed).
__clone()
protected
final __clone() : mixed