"""
stack = sys._current_frames()[thread.ident]
logging.critical('*' * 80)
- logging.critical('Stack dump for thread \'%s\'', thread.name)
+ logging.critical('Stack dump for thread %r', thread.name)
logging.critical('*' * 80)
for filename, lineno, name, line in traceback.extract_stack(stack):
logging.critical('File: "%s", line %d, in %s', filename, lineno, name)
for thread in self._threads:
thread.start()
- def _JoinAll(self, watcher=watchdog_timer.WatchdogTimer(None)):
+ def _JoinAll(self, watcher=None):
"""Join all threads without stack dumps.
Reraises exceptions raised by the child threads and supports breaking
Args:
watcher: Watchdog object providing timeout, by default waits forever.
"""
+ if watcher is None:
+ watcher = watchdog_timer.WatchdogTimer(None)
alive_threads = self._threads[:]
while alive_threads:
for thread in alive_threads[:]:
for thread in self._threads:
thread.ReraiseIfException()
- def JoinAll(self, watcher=watchdog_timer.WatchdogTimer(None)):
+ def JoinAll(self, watcher=None):
"""Join all threads.
Reraises exceptions raised by the child threads and supports breaking
LogThreadStack(thread)
raise
- def GetAllReturnValues(self, watcher=watchdog_timer.WatchdogTimer(None)):
+ def GetAllReturnValues(self, watcher=None):
"""Get all return values, joining all threads if necessary.
Args: