Index: includes/lock.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/lock.inc,v
retrieving revision 1.1.2.4
diff -u -9 -p -r1.1.2.4 lock.inc
--- includes/lock.inc	11 May 2010 09:30:20 -0000	1.1.2.4
+++ includes/lock.inc	23 Mar 2011 21:20:12 -0000
@@ -97,19 +97,20 @@ function _lock_id() {
 function lock_acquire($name, $timeout = 30.0) {
   global $locks;
 
   // Insure that the timeout is at least 1 ms.
   $timeout = max($timeout, 0.001);
   list($usec, $sec) = explode(' ', microtime());
   $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]);
     }
   }
   else {
     // Optimistically try to acquire the lock, then retry once if it fails.
     // The first time through the loop cannot be a retry.
     $retry = FALSE;
     // We always want to do this code at least once.
