PHP Class Jenner\SimpleFork\Lock\Semaphore

Inheritance: implements Jenner\SimpleFork\Lock\LockInterface
Afficher le fichier Open project: huyanping/simple-fork-php Class Usage Examples

Méthodes publiques

Méthode Description
__destruct ( ) release lock
acquire ( boolean $blocking = true ) : boolean get a lock
create ( $key ) : Semaphore create a lock instance
isLocked ( ) : boolean is locked
release ( ) : boolean release lock

Méthodes protégées

Méthode Description
_stringToSemKey ( $identifier ) : integer Semaphore requires a numeric value as the key

Private Methods

Méthode Description
__construct ( $key, $count = 1 ) init a lock

Method Details

__destruct() public méthode

release lock
public __destruct ( )

_stringToSemKey() protected méthode

Semaphore requires a numeric value as the key
protected _stringToSemKey ( $identifier ) : integer
$identifier
Résultat integer

acquire() public méthode

get a lock
public acquire ( boolean $blocking = true ) : boolean
$blocking boolean
Résultat boolean

create() public static méthode

create a lock instance
public static create ( $key ) : Semaphore
$key
Résultat Semaphore

isLocked() public méthode

is locked
public isLocked ( ) : boolean
Résultat boolean

release() public méthode

release lock
public release ( ) : boolean
Résultat boolean