PHP 클래스 Icicle\Concurrent\Threading\Semaphore

This is an implementation of a thread-safe semaphore that has non-blocking acquire methods. There is a small tradeoff for asynchronous semaphores; you may not acquire a lock immediately when one is available and there may be a small delay. However, the small delay will not block the thread.
상속: implements Icicle\Concurrent\Sync\SemaphoreInterface
파일 보기 프로젝트 열기: icicleio/concurrent

공개 메소드들

메소드 설명
__clone ( ) Clones the semaphore, creating a new instance with the same number of locks, all available.
__construct ( integer $locks ) Creates a new semaphore with a given number of locks.
acquire ( ) : Generator
count ( ) : integer
getSize ( ) : integer

비공개 메소드들

메소드 설명
init ( integer $locks ) Initializes the semaphore with a given number of locks.

메소드 상세

__clone() 공개 메소드

Clones the semaphore, creating a new instance with the same number of locks, all available.
public __clone ( )

__construct() 공개 메소드

Creates a new semaphore with a given number of locks.
public __construct ( integer $locks )
$locks integer The maximum number of locks that can be acquired from the semaphore.

acquire() 공개 메소드

public acquire ( ) : Generator
리턴 Generator

count() 공개 메소드

public count ( ) : integer
리턴 integer

getSize() 공개 메소드

public getSize ( ) : integer
리턴 integer