Re: semaphores not automatically releasing at end of script
| From: | Thomas | Date: | Wed, 05 Dec 2001 09:29:51 +0000 |
| Subject: | Re: semaphores not automatically releasing at end of script | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-76673@lists.php.net to get a copy of this message | ||
The following code fails after the first call:
if(!($lock_id = sem_get(2501)) || !sem_acquire($lock_id))
die('failed to get semaphore')
..do something, error triggers "exit;"..
sem_release($lock_id)
But having sem_release right after acquire makes everything work ok. I
use FreeBSD and see there was some report of a similar problem at
bugs.php.net, but there is no solution, patch, work arounds, etc posted.