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

DONTBUILD (NPOTB)

--HG--
extra : rebase_source : 373c1fa5e47a2493970da0412788c55b9bdd9ef8
This commit is contained in:
Gregory Szorc 2013-06-19 12:10:57 -07:00
Родитель c01728024c
Коммит 3e48e57775
1 изменённых файлов: 13 добавлений и 8 удалений

Просмотреть файл

@ -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):