lock: the correct way to do a trylock() is to use a timeout of 0
authorBenoit Boissinot <benoit.boissinot@ens-lyon.org>
Mon, 16 Nov 2009 11:55:29 +0100
changeset 9858 ea38a2c1bdd3
parent 9857 24bc6e414610
child 9859 951ec6c7d703
lock: the correct way to do a trylock() is to use a timeout of 0
mercurial/lock.py
--- 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: