PrefixedKeyedMutex
in package
implements
KeyedMutex
uses
ForbidCloning, ForbidSerialization
FinalYes
Table of Contents
Interfaces
- KeyedMutex
- A synchronization primitive that can be used for mutual exclusion across contexts based on keys.
Properties
- $mutex : KeyedMutex
- $prefix : string
Methods
- __construct() : mixed
- __serialize() : never
- __unserialize() : never
- acquire() : Lock
- Acquires a lock on the mutex.
- __clone() : mixed
Properties
$mutex read-only
private
KeyedMutex
$mutex
$prefix read-only
private
string
$prefix
Methods
__construct()
public
__construct(KeyedMutex $mutex, string $prefix) : mixed
Parameters
- $mutex : KeyedMutex
- $prefix : 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.
public
acquire(string $key) : Lock
Parameters
- $key : string
-
Lock key
Return values
Lock —Returns a lock object with an ID of 0. 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