On Tuesday 23 November 2004 23:06, Hans Meine wrote:
> from reading the comment about thread-safety, I would propose one of the
> attached patches (the _shorter one doing the acquire() before the len()
> call) just to be sure.

GRRRRRRRRRRRR! I don't get it - everytime when I send a patch, I manage to 
introduce some spurious tabs in the last moment, just before doing the final 
"cvs diff". :-( Inspite of my desperate attempts to double-check everything 
in my xemacs with whitespace-mode.. :(
(The same happend with my last nvram-wakeup patch IIRC.)

Here is the shorter version again..

-- 
Ciao, /  /                                                    .o.
     /--/                                                     ..o
    /  / ANS                                                  ooo
Index: rc.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/Attic/rc.py,v
retrieving revision 1.36.2.1
diff -u -3 -p -d -r1.36.2.1 rc.py
--- rc.py	20 Oct 2004 18:31:46 -0000	1.36.2.1
+++ rc.py	23 Nov 2004 22:12:43 -0000
@@ -495,12 +495,14 @@ class EventHandler:
 
                 
         # search for events in the queue
-        if len(self.queue):
-            self.lock.acquire()
-            ret = self.queue[0]
-            del self.queue[0]
+        self.lock.acquire()
+        try:
+            if len(self.queue):
+                ret = self.queue[0]
+                del self.queue[0]
+                return ret
+        finally:
             self.lock.release()
-            return ret
 
         # search all input objects for new events
         for i in self.inputs:

Reply via email to