I have to block, for an exclusive use, a part of code or a function.
How can I make it with PHP and what is 'key' parameter for 'sem_get'?
I have to recompile PHP? and witch options I have to use?
Thank in advances.
July 12th, 2000, 11:32 AM
You will need something along these lines:
$i = sem_get("NAME");
// pout your code here
The NAME is a string you can come up with yourself. The system gives back a number which you have to use in the semaphore.
The thing I'm not certain about is the behaviour of sem_acquire. Does it block when not getting the semaphore or does it return false and continue? Manual is not quite clear about that.