phasync\Util\Synchronized final class

Documentation

Simple coroutine-safe mutex for synchronizing access to shared resources.

This implementation is not reentrant - attempting to acquire the same lock from within a locked context will throw an exception. For reentrant locking, use LockTrait instead.

Note: Not thread safe if PHP threading is enabled.

Properties (2)

private static array $locks
private static array $holders

Methods (1)

Run a function ensuring that the function will not be invoked by other

Source

src/Util/Synchronized.php:14-50