Index: memcache-lock.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/memcache/Attic/memcache-lock.inc,v
retrieving revision 1.1.2.3
diff -u -p -r1.1.2.3 memcache-lock.inc
--- memcache-lock.inc	28 Sep 2010 16:59:03 -0000	1.1.2.3
+++ memcache-lock.inc	12 Nov 2010 15:36:01 -0000
@@ -89,12 +89,14 @@ function lock_may_be_available($name) {
  *   TRUE if the lock holds, FALSE if it is available.
  */
 function lock_wait($name, $delay = 30) {
-  $delay = (int) $delay;
+  // Multiply delay by ten, since we will poll every 1/10th of a second.
+  $delay = (int) $delay * 10;
   while ($delay--) {
     // This function should only be called by a request that failed to get a
     // lock, so we sleep first to give the parallel request a chance to finish
-    // and release the lock.
-    sleep(1);
+    // and release the lock. Use usleep for 100ms, instead of sleep(1),  so that
+    // processes don't wait around too much longer than necessary.
+    usleep(100000);
     if (!dmemcache_get($name, 'semaphore')) {
       // No longer need to wait.
       return FALSE;
