Home > PHP > Function > Semaphore > sem_acquire()

sem_acquire()

sem_acquire - Acquire a semaphore

Syntax

bool sem_acquire (resource $sem_identifier)

Arguments

  • sem_identifier - sem_identifier is a semaphore resource, obtained from sem_get().

Description

sem_acquire() blocks (if necessary) until the semaphore can be acquired. A process attempting to acquire a semaphore which it has already acquired will block forever if acquiring the semaphore would cause its maximum number of semaphore to be exceeded.

Version

PHP 4, 5

Return value

Returns TRUE on success or FALSE on failure.