Bug 1064960 - [mozprocess] Guard against the output thread trying to join with itself. r=ahal
authorPankaj Malhotra(:bitgeeky) <mozpankaj1994@gmail.com>
Tue, 04 Nov 2014 02:35:00 +0100
changeset 214264 318f0e7012349997a08b2ac2c42452ea30d4c22f
parent 214263 746fe1b6398bf00a8c1b504e07d1916e91f35ef0
child 214265 6a21dd57eeb3d7712012f3ceda7a4cdc84746d82
push id51456
push usercbook@mozilla.com
push dateThu, 06 Nov 2014 08:42:56 +0000
treeherdermozilla-inbound@6a21dd57eeb3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersahal
bugs1064960
milestone36.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1064960 - [mozprocess] Guard against the output thread trying to join with itself. r=ahal
testing/mozbase/mozprocess/mozprocess/processhandler.py
--- a/testing/mozbase/mozprocess/mozprocess/processhandler.py
+++ b/testing/mozbase/mozprocess/mozprocess/processhandler.py
@@ -807,17 +807,17 @@ falling back to not using job objects fo
         does not kill the process.
 
         Returns the process exit code value:
         - None if the process hasn't terminated yet
         - A negative number if the process was killed by signal N (Unix only)
         - '0' if the process ended without failures
 
         """
-        if self.outThread:
+        if self.outThread and self.outThread is not threading.current_thread():
             # Thread.join() blocks the main thread until outThread is finished
             # wake up once a second in case a keyboard interrupt is sent
             count = 0
             while self.outThread.isAlive():
                 self.outThread.join(timeout=1)
                 count += 1
                 if timeout and count > timeout:
                     return None