summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--includes/lock.inc3
1 files changed, 2 insertions, 1 deletions
diff --git a/includes/lock.inc b/includes/lock.inc
index 0bc6786..7259ad9 100644
--- a/includes/lock.inc
+++ b/includes/lock.inc
@@ -102,7 +102,8 @@ function lock_acquire($name, $timeout = 30.0) {
$expire = (float)$usec + (float)$sec + $timeout;
if (isset($locks[$name])) {
// Try to extend the expiration of a lock we already acquired.
- if (!db_result(db_query("UPDATE {semaphore} SET expire = %f WHERE name = '%s' AND value = '%s'", $expire, $name, _lock_id()))) {
+ db_query("UPDATE {semaphore} SET expire = %f WHERE name = '%s' AND value = '%s'", $expire, $name, _lock_id());
+ if (!db_affected_rows()) {
// The lock was broken.
unset($locks[$name]);
}