Jet\Lock

Facade for using the lock subsystem.

Method Description
public static setLockBackendClass(
string $lock_backend_class
) : void
Sets which lock backend will be used.
public static getLockBackendClass(
) : string
Returns the current class name of the lock backend.
protected static getLock(
string $lock_name
) : Lock_Backend
Creates (if it does not already exist) a lock with the given name and returns its instance, but does not perform the locking.
public static waitForLock(
string $lock_name,
?float $max_wait_seconds=null
) : bool
Acquires and locks the lock with the given name. If this is not possible (the lock is held by another process), it retries until the lock is successfully acquired and locked, or until the time limit defined by the $max_wait_seconds parameter expires. If it fails to acquire and lock the lock even then, it returns false; on success, it returns true.
public static lockIfPossible(
string $lock_name
) : bool
Acquires and locks the lock with the given name. If this is not possible (the lock is held by another process), it immediately returns false.
public static unlock(
string $lock_name
) : void
Unlocks the lock with the given name.
public static unlockAll(
) : void
Unlocks all locks.
Previous chapter
Lock
Next chapter
Backend