Documentation

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

Methods

__unserialize()

public final __unserialize(array<string|int, mixed> $data) : never
Parameters
$data : array<string|int, mixed>
Return values
never

acquire()

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).


        
On this page

Search results