fix bug: Beremiz IDE hangs during launching Beremiz_service
authorandrey@new-nest
Fri, 06 May 2016 22:21:22 +0300
changeset 1516 9db0b436fbb3
parent 1515 da8bf5aa275f
child 1517 30692ab8b5c7
fix bug: Beremiz IDE hangs during launching Beremiz_service

this is regression introduced as side effect by d7f474d [fix issue
with sometimes wrong return code of ProcessLogger]
util/ProcessLogger.py
--- a/util/ProcessLogger.py	Fri May 06 19:14:10 2016 +0300
+++ b/util/ProcessLogger.py	Fri May 06 22:21:22 2016 +0300
@@ -175,6 +175,7 @@
             self.log_the_end(ecode,pid)
         if self.finish_callback is not None:
             self.finish_callback(self,ecode,pid)
+        self.errt.join()
         self.finishsem.release()
 
     def kill(self,gently=True):
@@ -199,14 +200,12 @@
 
     def endlog(self):
         if self.endlock.acquire(False):
-            self.finishsem.release()
             if not self.outt.finished and self.kill_it:
                self.kill()
+            self.finishsem.release()
 
 
     def spin(self):
         self.finishsem.acquire()
-        self.outt.join()
-        self.errt.join()
         return [self.exitcode, "".join(self.outdata), "".join(self.errdata)]