changeset 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 24bc6e414610
children 951ec6c7d703
files mercurial/lock.py
diffstat 1 files changed, 1 insertions(+), 2 deletions(-) [+]
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: