PHP  
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
search for in the  
<sem_acquiresem_release>
Last updated: Mon, 16 Jul 2012

sem_get

(PHP 3 >= 3.0.6, PHP 4, PHP 5)

sem_get -- Get a semaphore id

Description

resource sem_get ( int key [, int max_acquire [, int perm [, int auto_release]]] )

sem_get() returns an id that can be used to access the System V semaphore with the given key. The semaphore is created if necessary using the permission bits specified in perm (defaults to 0666). The number of processes that can acquire the semaphore simultaneously is set to max_acquire (defaults to 1). Actually this value is set only if the process finds it is the only process currently attached to the semaphore.

Optional parameter auto_release specifies if the semaphore should be automatically released on request shutdown. It is available since PHP 4.3.0.

Returns a positive semaphore identifier on success, or FALSE on error.

A second call to sem_get() for the same key will return a different semaphore identifier, but both identifiers access the same underlying semaphore.

See also sem_acquire(), sem_release(), and ftok().




<sem_acquiresem_release>
 Last updated: Mon, 16 Jul 2012
 
Copyright © 2001-2005 The PHP Group
All rights reserved.
This unofficial mirror is operated at: http://manual.phpv.net/
Last updated: Thu Jul 7 19:13:47 2005 CST