From: Andrew Dolgov Date: Sun, 12 Feb 2006 07:21:52 +0000 (+0100) Subject: add make_lockfile() X-Git-Tag: 1.1.3~34 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=fcb4c0c93bf51858321cab7a3101b71270cbbd84;p=tt-rss.git add make_lockfile() --- diff --git a/functions.php b/functions.php index d502d08d..55e78548 100644 --- a/functions.php +++ b/functions.php @@ -928,4 +928,14 @@ } } + function make_lockfile($filename) { + $fp = fopen($filename, "w"); + + if (flock($fp, LOCK_EX | LOCK_NB)) { + return $fp; + } else { + return false; + } + } + ?>