PHP Класс malkusch\lock\util\DoubleCheckedLocking

You should not instantiate this class directly. Use {@link Mutex::check()}.
Автор: Markus Malkusch ([email protected])
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__construct ( Mutex $mutex ) Sets the mutex.
setCheck ( callable $check ) Sets the check.
then ( callable $code ) Executes a code only if a check is true.

Описание методов

__construct() публичный Метод

Sets the mutex.
public __construct ( Mutex $mutex )
$mutex malkusch\lock\mutex\Mutex The mutex.

setCheck() публичный Метод

Sets the check.
public setCheck ( callable $check )
$check callable The check.

then() публичный Метод

Both the check and the code execution are locked by a mutex. Only if the check fails the method returns before acquiring a lock.
public then ( callable $code )
$code callable The locked code.