diff options
author | Andrew Dolgov <[email protected]> | 2006-02-12 08:21:52 +0100 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2006-02-12 08:21:52 +0100 |
commit | fcb4c0c93bf51858321cab7a3101b71270cbbd84 (patch) | |
tree | d16e48049c8af8c45932edb0793100858afed130 | |
parent | 6eafcac62f0a7c4174c3aea364b144a5f671bdd3 (diff) |
add make_lockfile()
-rw-r--r-- | functions.php | 10 |
1 files changed, 10 insertions, 0 deletions
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; + } + } + ?> |