PrefixedKeyedSemaphore
in package
implements
KeyedSemaphore
uses
ForbidCloning, ForbidSerialization
FinalYes
Table of Contents
Interfaces
- KeyedSemaphore
- A counting semaphore based on keys.
Properties
- $prefix : string
- $semaphore : KeyedSemaphore
Methods
- __construct() : mixed
- __serialize() : never
- __unserialize() : never
- acquire() : Lock
- Acquires a lock on the semaphore.
- __clone() : mixed
Properties
$prefix read-only
private
string
$prefix
$semaphore read-only
private
KeyedSemaphore
$semaphore
Methods
__construct()
public
__construct(KeyedSemaphore $semaphore, string $prefix) : mixed
Parameters
- $semaphore : KeyedSemaphore
- $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 semaphore.
public
acquire(string $key) : Lock
Parameters
- $key : string
-
Lock key
Return values
Lock —Returns an integer keyed lock object once a lock is obtained. Identifiers returned by the locks should be 0-indexed. Releasing an identifier MUST make that same identifier available. 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