[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[minion-cvs] Bug 29] Use explicit values for blocking=0/1 for Lockfi...



Update of /home/minion/cvsroot/src/minion/lib/mixminion/directory
In directory moria.mit.edu:/tmp/cvs-serv29341/lib/mixminion/directory

Modified Files:
	ServerList.py 
Log Message:
[Bug 29] Use explicit values for blocking=0/1 for Lockfile.acquire.
It turns out that the default behavior (blocking=0) did _not_ obey the
threading.*Lock interface, which in turn threw ClientDirectory for a
loop.

If the directory tried to acquire the lock, and there was contention,
it would die with an exception.  Not any more, I hope.

In 0.0.8, we should change Lockfile to Do The Right Thing.


Index: ServerList.py
===================================================================
RCS file: /home/minion/cvsroot/src/minion/lib/mixminion/directory/ServerList.py,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -d -r1.51 -r1.52
--- ServerList.py	7 Mar 2004 06:31:46 -0000	1.51
+++ ServerList.py	23 Mar 2004 05:15:17 -0000	1.52
@@ -475,7 +475,7 @@
 
     def _lock(self):
         self.rlock.acquire()
-        self.lockfile.acquire()
+        self.lockfile.acquire(blocking=1)
 
     def _unlock(self):
         self.lockfile.release()