PHP 클래스 malkusch\lock\util\DoubleCheckedLocking

You should not instantiate this class directly. Use {@link Mutex::check()}.
저자: Markus Malkusch ([email protected])
파일 보기 프로젝트 열기: malkusch/lock 1 사용 예제들

공개 메소드들

메소드 설명
__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.