add make_lockfile()
This commit is contained in:
parent
6eafcac62f
commit
fcb4c0c93b
1 changed files with 10 additions and 0 deletions
|
@ -928,4 +928,14 @@
|
|||
}
|
||||
}
|
||||
|
||||
function make_lockfile($filename) {
|
||||
$fp = fopen($filename, "w");
|
||||
|
||||
if (flock($fp, LOCK_EX | LOCK_NB)) {
|
||||
return $fp;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
Loading…
Reference in a new issue