PHP Class NinjaMutex\Tests\Mock\MockLock

Author: Kamil Dziedzic ([email protected])
Inheritance: implements NinjaMutex\Lock\LockInterface
显示文件 Open project: arvenil/ninja-mutex Class Usage Examples

Protected Properties

Property Type Description
$available boolean Whether the service is available
$counter integer Lock counter to protect against recursive deadlock

Public Methods

Method Description
acquireLock ( string $name, null | integer $timeout = null ) : boolean
isLocked ( $name ) : boolean
releaseLock ( $name ) : boolean
setAvailable ( boolean $available )

Method Details

acquireLock() public method

public acquireLock ( string $name, null | integer $timeout = null ) : boolean
$name string
$timeout null | integer
return boolean

isLocked() public method

public isLocked ( $name ) : boolean
$name
return boolean

releaseLock() public method

public releaseLock ( $name ) : boolean
$name
return boolean

setAvailable() public method

public setAvailable ( boolean $available )
$available boolean

Property Details

$available protected_oe property

Whether the service is available
protected bool $available
return boolean

$counter protected_oe property

Lock counter to protect against recursive deadlock
protected int $counter
return integer