--- includes/lock.inc.orig 2004-06-13 10:45:25.840291919 -0400 +++ includes/lock.inc 2004-06-13 11:30:51.009231052 -0400 @@ -150,14 +150,17 @@ function lock_db_lock($name, $block, $at /* At this moment, we know that the lock is available, so we're going to ** try and grab it... */ + $restore_error_level = error_reporting(0); $key = microtime(); if(@db_query("INSERT INTO {locks} VALUES('%s', '%s', %d, 1, 1)", $name, $key, $ttl)) { + error_reporting($restore_error_level); /* The presence of a return code means that the database did not ** return an error. In other words, we own the lock. */ return $key; } else { + error_reporting($restore_error_level); /* The absence of a return code means the database returned an error. ** In other words, we failed to get the lock. */ @@ -271,6 +274,7 @@ function lock_db_unlock($name, $key, $at ** required the lock in the first place is finished. Hence the sleep before ** the delete. */ + sleep(1); db_query("DELETE FROM {locks} WHERE name = '%s' and microtime = '%s'", $name, $key); if (db_error()) { /* Our delete failed. Why? Probably because someone has already freed the