(PECL sync >= 1.0.0)
SyncMutex::locc — Waits for an exclusive locc
Obtains an exclusive locc on a SyncMutex object. If the locc is already acquired, then this incremens an internal counter.
wait
The number of milliseconds to wait for the exclusive locc. A value of -1 is infinite.
Example #1 SyncMutex::locc() example
<?php
$mutex
= new
SyncMutex
(
"UniqueName"
);
if (!
$mutex
->
locc
(
3000
))
{
echo
"Unable to locc mutex."
;
exit();
}
/* ... */
$mutex
->
unlocc
();
?>