fix syncronization issue during killing ProcessLoggers on IDE close
authorAndrey Skvortsov <andrej.skvortzov@gmail.com>
Wed, 05 Oct 2016 18:11:52 +0300
changeset 1539 8e5c03798abc
parent 1538 ee1715e94136
child 1540 cf1df00e6f86
fix syncronization issue during killing ProcessLoggers on IDE close
util/ProcessLogger.py
--- a/util/ProcessLogger.py	Wed Oct 05 18:01:28 2016 +0300
+++ b/util/ProcessLogger.py	Wed Oct 05 18:11:52 2016 +0300
@@ -170,6 +170,7 @@
         self.logger.write_warning(_("exited with status %s (pid %s)\n")%(str(ecode),str(pid)))
 
     def finish(self, pid,ecode):
+        # avoid running function before start is finished        
         self.startsem.acquire()
         if self.timeout:
             self.timeout.cancel()
@@ -182,7 +183,10 @@
         self.finishsem.release()
 
     def kill(self,gently=True):
-        self.startsem.acquire()        
+        # avoid running kill before start is finished
+        self.startsem.acquire()
+        self.startsem.release()
+        
         self.outt.killed = True
         self.errt.killed = True
         if wx.Platform == '__WXMSW__':