downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

sem_get> <msg_stat_queue
Last updated: Fri, 20 May 2011

view this page in

sem_acquire

(PHP 4, PHP 5)

sem_acquireAdquirir un semáforo

Descripción

bool sem_acquire ( resource $sem_identifier )

sem_acquire() se bloquea (si es necesario) hasta que el semáforo pueda ser adquirido. Un proceso que intente adquirir un semáforo que ya ha sido adquirido se bloqueará para siempre si al adquirir el semáforo causa que su número máximo de semáforo sea excedido.

Después de procesar una petición, cualquier semáforo adquirido por el proceso pero no liberado explícitamente será liberado automáticamente y se generará un mensaje de tipo warning.

Parámetros

sem_identifier

sem_identifier es un recurso de semáforo obtenido desde sem_get().

Valores devueltos

Devuelve TRUE en caso de éxito o FALSE en caso de error.

Ver también



add a note add a note User Contributed Notes sem_acquire
gladd at trash dot eris dot qinetiq dot com 13-Apr-2004 09:02
Just to clarify what is meant by "process" above:

On the Apache webserver, many PHP requests will be executed within the same process space because it is multithreaded. However, any semaphores got and acquired by a script and not released and removed will still be automatically cleaned up by the PHP interpreter each time the script terminates.

Remove any trash before emailing!

 
show source | credits | stats | sitemap | contact | advertising | mirror sites