summaryrefslogtreecommitdiffstats
path: root/classes/script_start.php
diff options
context:
space:
mode:
authorGit <git@what.cd>2012-10-09 08:00:17 +0000
committerGit <git@what.cd>2012-10-09 08:00:17 +0000
commit0be451b5525c29dbc52026bc211d6c2f9afed94b (patch)
tree11c69fc4f8bd780346dad2e037d5f6ddaa521c49 /classes/script_start.php
parent8e4937f6ff45f88540402415b419ce3d0f6bb353 (diff)
downloadGazelle-0be451b5525c29dbc52026bc211d6c2f9afed94b.zip
Gazelle-0be451b5525c29dbc52026bc211d6c2f9afed94b.tar.gz
Gazelle-0be451b5525c29dbc52026bc211d6c2f9afed94b.tar.bz2
Empty commit
Diffstat (limited to 'classes/script_start.php')
-rw-r--r--classes/script_start.php34
1 files changed, 34 insertions, 0 deletions
diff --git a/classes/script_start.php b/classes/script_start.php
index 18d28b5..147b0ee 100644
--- a/classes/script_start.php
+++ b/classes/script_start.php
@@ -2534,6 +2534,40 @@ function isset_request($Request, $Keys=NULL, $AllowEmpty = False, $Error=0) {
}
}
+/**
+ * Test if there's an active lock with the given name
+ *
+ * @param string $LockName name on the lock
+ * @return true if lock is active
+ */
+function query_locked($LockName) {
+ global $Cache;
+ if ($Cache->get_value('query_lock_'.$LockName) !== false) {
+ return true;
+ }
+ return false;
+}
+
+/**
+ * Add lock. Expiry time is one hour to avoid indefinite locks
+ *
+ * @param string $LockName name on the lock
+ */
+function set_query_lock($LockName) {
+ global $Cache;
+ $Cache->cache_value('query_lock_'.$LockName, 1, 3600);
+}
+
+/**
+ * Remove lock. Expiry time is one hour to avoid indefinite locks
+ *
+ * @param string $LockName name on the lock
+ */
+function clear_query_lock($LockName) {
+ global $Cache;
+ $Cache->delete_value('query_lock_'.$LockName);
+}
+
$Debug->set_flag('ending function definitions');
//Include /sections/*/index.php
$Document = basename(parse_url($_SERVER['SCRIPT_FILENAME'], PHP_URL_PATH), '.php');