PHP 클래스 Icicle\Concurrent\Sync\PosixSemaphore

Uses a POSIX message queue to store a queue of permits in a lock-free data structure. This semaphore implementation is preferred over other implementations when available, as it provides the best performance. Not compatible with Windows.
상속: implements Icicle\Concurrent\Sync\SemaphoreInterface, implements Serializable
파일 보기 프로젝트 열기: icicleio/concurrent

공개 메소드들

메소드 설명
__clone ( ) Clones the semaphore, creating a new semaphore with the same size and permissions.
__construct ( integer $maxLocks, integer $permissions = 384 ) Creates a new semaphore with a given number of locks.
acquire ( ) : Generator
count ( ) : integer
free ( ) Removes the semaphore if it still exists.
getPermissions ( ) : integer Gets the access permissions of the semaphore.
getSize ( ) : integer Gets the maximum number of locks held by the semaphore.
isFreed ( ) : boolean Checks if the semaphore has been freed.
serialize ( ) : string Serializes the semaphore.
setPermissions ( integer $mode ) Sets the access permissions of the semaphore.
unserialize ( string $serialized ) Unserializes a serialized semaphore.

보호된 메소드들

메소드 설명
release ( ) Releases a lock from the semaphore.

비공개 메소드들

메소드 설명
init ( integer $maxLocks, integer $permissions )

메소드 상세

__clone() 공개 메소드

Clones the semaphore, creating a new semaphore with the same size and permissions.
public __clone ( )

__construct() 공개 메소드

Creates a new semaphore with a given number of locks.
public __construct ( integer $maxLocks, integer $permissions = 384 )
$maxLocks integer The maximum number of locks that can be acquired from the semaphore.
$permissions integer Permissions to access the semaphore.

acquire() 공개 메소드

public acquire ( ) : Generator
리턴 Generator

count() 공개 메소드

public count ( ) : integer
리턴 integer

free() 공개 메소드

Removes the semaphore if it still exists.
public free ( )

getPermissions() 공개 메소드

Gets the access permissions of the semaphore.
public getPermissions ( ) : integer
리턴 integer A permissions mode.

getSize() 공개 메소드

Gets the maximum number of locks held by the semaphore.
public getSize ( ) : integer
리턴 integer The maximum number of locks held by the semaphore.

isFreed() 공개 메소드

Checks if the semaphore has been freed.
public isFreed ( ) : boolean
리턴 boolean True if the semaphore has been freed, otherwise false.

release() 보호된 메소드

Releases a lock from the semaphore.
protected release ( )

serialize() 공개 메소드

Serializes the semaphore.
public serialize ( ) : string
리턴 string The serialized semaphore.

setPermissions() 공개 메소드

The current user must have access to the semaphore in order to change the permissions.
public setPermissions ( integer $mode )
$mode integer A permissions mode to set.

unserialize() 공개 메소드

Unserializes a serialized semaphore.
public unserialize ( string $serialized )
$serialized string The serialized semaphore.