mailr14583 - /1.3/gui/interpreter.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by edward on September 05, 2011 - 15:50:
Author: bugman
Date: Mon Sep  5 15:50:15 2011
New Revision: 14583

URL: http://svn.gna.org/viewcvs/relax?rev=14583&view=rev
Log:
Mac OS X bug fix for racing in the GUI interpreter thread.

The flush() method was not working properly on Mac OS X, so hopefully now it 
is thread-safe.  There
are conditions where it could fail though, and the current solution is a bit 
of a hack.


Modified:
    1.3/gui/interpreter.py

Modified: 1.3/gui/interpreter.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/gui/interpreter.py?rev=14583&r1=14582&r2=14583&view=diff
==============================================================================
--- 1.3/gui/interpreter.py (original)
+++ 1.3/gui/interpreter.py Mon Sep  5 15:50:15 2011
@@ -231,9 +231,17 @@
     def flush(self):
         """Return only once the queue is empty."""
 
+        # Wait a little while to prevent races with the reading of the queue.
+        sleep(0.5)
+
         # Loop until empty.
         while not self.empty():
+            # Wait a bit for the queue to empty.
             sleep(0.2)
+
+            # Wait until execution is complete.
+            while status.exec_lock.locked():
+                sleep(0.5)
 
 
     def join(self):




Related Messages


Powered by MHonArc, Updated Mon Sep 05 17:20:02 2011