A handle on an acquired lock from a synchronization object.
This object is not thread-safe; after acquiring a lock from a mutex or semaphore, the lock must reside in the same thread or process until it is released.
new Lock(callable(Lock $lock) $releaser)
Creates a new lock permit object.
- A function to be called upon release.
Checks if the lock has already been released. Returns true if the lock has already been released, otherwise returns false.
True if the lock has already been released, otherwise false.
Releases the lock to the mutex or semaphore that the lock was acquired from.
- Thrown if the lock was already released.