Locker
class Locker
Properties
| static protected Channel> | $channels |
Methods
static bool
lock(string $key, float $timeout = -1)
Acquire the lock for the given key, or wait until its owner releases it.
static void
unlock(string $key)
Release the lock for the given key.
static void
flushState()
Flush all static state.
Details
at line 31
static bool
lock(string $key, float $timeout = -1)
Acquire the lock for the given key, or wait until its owner releases it.
Returns true when the caller becomes the owner, which must release the lock in a finally block. Returns false once the owner has released it. A waiter then re-checks the shared result and, when the owner left none, calls lock() again, so one waiter becomes the next owner instead of all repeating the work.
at line 56
static void
unlock(string $key)
Release the lock for the given key.
at line 68
static void
flushState()
Flush all static state.