diff mercurial/lock.py @ 9858:ea38a2c1bdd3

lock: the correct way to do a trylock() is to use a timeout of 0
author Benoit Boissinot <benoit.boissinot@ens-lyon.org>
date Mon, 16 Nov 2009 11:55:29 +0100
parents a820cd39d415
children 25e572394f5c
line wrap: on
line diff
--- a/mercurial/lock.py	Sat Nov 14 14:21:53 2009 +0100
+++ b/mercurial/lock.py	Mon Nov 16 11:55:29 2009 +0100
@@ -112,8 +112,7 @@
         # if locker dead, break lock.  must do this with another lock
         # held, or can race and break valid lock.
         try:
-            l = lock(self.f + '.break')
-            l.trylock()
+            l = lock(self.f + '.break', timeout=0)
             os.unlink(self.f)
             l.release()
         except error.LockError: