$sem = new IPC::Semaphore(key, nsems, flags)
Creates a new semaphore set associated with
key and containing
nsems semaphores. Uses
flags to set the permissions. Creates the
new set if the following are true:
-
key is equal to IPC_PRIVATE.
-
key doesn't already have
an associated semaphore identifier, and FLAGS &
IPC_CREAT is true.
$sem->getall
Returns the values of the semaphore set as an array.
$sem->getncnt(sem)
Returns the number of processes waiting for the semaphore
sem to become greater than its current
value.
$sem->getpid(sem)
Returns the process ID of the last process that operated on semaphore
sem.
$sem->getval(sem)
Returns the current value of semaphore sem.
$sem->getzcnt(sem)
Returns the number of processes waiting for the semaphore
sem to become 0.
$sem->id
Returns the system identifier for the semaphore set.