summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGábor Hojtsy2011-11-23 10:43:59 (GMT)
committer Gábor Hojtsy2011-11-23 10:43:59 (GMT)
commit3905244d677900115901948bcfbc089079d7f524 (patch)
treea893f29f9ddca9913ff653894147daf9fb2c99d9
parente5dbe7a9b6aa1634dfb98693df409dd9c8fa6566 (diff)
Issue #1103310 by c960657: lock_acquire() does not properly extend expired lock due to misuse of db_query() to check for affected rows
-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]);
}