Hello there,
I am using semaphores to synchronize access to specific database
records. Problem is, it does not seem that the semaphores are being
released. Not only am I using sem_release() but the PHP manual says it
will release all semaphores that are still acquired at the end of the
PHP page loading.

Here is my simple code:
function writeLock($mid) {
  if(!$mid) mydi('attempt to lock data 0');
  if(!($lock_id = sem_get(2500+200+$mid%100)) || !sem_acquire($lock_id))
    mydi('locking match.');
  return $lock_id;
function unwriteLock($lock_id) {
  if(!$lock_id) mydi('attempt to unlock 0');
    mydi('unlocking information.');


PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to