From fcb4c0c93bf51858321cab7a3101b71270cbbd84 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sun, 12 Feb 2006 08:21:52 +0100 Subject: [PATCH] add make_lockfile() --- functions.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/functions.php b/functions.php index d502d08d4..55e785488 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; + } + } + ?>