Sync SyncSemaphore 클래스
(PECL sync >= 1.0.0)
소개
명명된 및 명명되지 않은 세마포 개체의 플랫폼 간 기본 구현입니다.
세마포는 제한된 리소스에 대한 액세스를 제한된 수의 인스턴스로 제한합니다. 세마포어는 둘 이상의 인스턴스가 한 번에 리소스에 액세스할 수 있도록 허용하는 반면 뮤텍스는 한 번에 하나의 인스턴스만 허용한다는 점에서 뮤텍스와 다릅니다.
클래스 개요
class SyncSemaphore {
/* Methods */
public __construct(string $name = ?, int $initialval = 1, bool $autounlock = true)
public lock(int $wait = -1): bool
public unlock(int &$prevcount = ?): bool
}
목차
- SyncSemaphore::__construct — Constructs a new SyncSemaphore object
- SyncSemaphore::lock — Decreases the count of the semaphore or waits
- SyncSemaphore::unlock — Increases the count of the semaphore