note 120274 added to function.flock
| From: | markus at malkusch dot de | Date: | Sun, 04 Dec 2016 19:20:41 +0000 |
| Subject: | note 120274 added to function.flock | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-208221@lists.php.net to get a copy of this message | ||
And here's the timeout template for UNIX:
<?php
pcntl_signal(SIGALRM, function() {});
pcntl_alarm(3);
try {
if (!flock($handle, LOCK_EX)) {
throw new \Exception("Timeout");
}
} finally {
pcntl_alarm(0);
pcntl_signal_dispatch();
pcntl_signal(SIGALRM, SIG_DFL);
}
?>
----
Server IP: 72.52.91.14
Probable Submitter: 2a00:c1a0:4887:ed00:3e97:eff:fe97:14f7
----
Manual Page -- http://php.net/manual/en/function.flock.php
Edit -- https://master.php.net/note/edit/120274
Del: integrated -- https://master.php.net/note/delete/120274/integrated
Del: useless -- https://master.php.net/note/delete/120274/useless
Del: bad code -- https://master.php.net/note/delete/120274/bad+code
Del: spam -- https://master.php.net/note/delete/120274/spam
Del: non-english -- https://master.php.net/note/delete/120274/non-english
Del: in docs -- https://master.php.net/note/delete/120274/in+docs
Del: other reasons-- https://master.php.net/note/delete/120274
Reject -- https://master.php.net/note/reject/120274
Search -- https://master.php.net/manage/user-notes.php