Bug 884028 - Acquire lock before writing to terminal; r=ted

DONTBUILD (NPOTB)
This commit is contained in:
Gregory Szorc
2013-06-19 12:10:57 -07:00
parent a0b258ddb5
commit be38a5784f

View File

@@ -66,17 +66,22 @@ class TerminalLoggingHandler(logging.Handler):
def emit(self, record):
msg = self.format(record)
if self.footer:
self.footer.clear()
self.acquire()
self.fh.write(msg)
self.fh.write('\n')
try:
if self.footer:
self.footer.clear()
if self.footer:
self.footer.draw()
self.fh.write(msg)
self.fh.write('\n')
# If we don't flush, the footer may not get drawn.
self.flush()
if self.footer:
self.footer.draw()
# If we don't flush, the footer may not get drawn.
self.fh.flush()
finally:
self.release()
class BuildProgressFooter(object):