summaryrefslogtreecommitdiff
path: root/functions.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2006-02-12 08:21:52 +0100
committerAndrew Dolgov <[email protected]>2006-02-12 08:21:52 +0100
commitfcb4c0c93bf51858321cab7a3101b71270cbbd84 (patch)
treed16e48049c8af8c45932edb0793100858afed130 /functions.php
parent6eafcac62f0a7c4174c3aea364b144a5f671bdd3 (diff)
add make_lockfile()
Diffstat (limited to 'functions.php')
-rw-r--r--functions.php10
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;
+ }
+ }
+
?>