Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / build / android / pylib / utils / reraiser_thread.py
index 2964bef..0ec16b1 100644 (file)
@@ -26,7 +26,7 @@ def LogThreadStack(thread):
   """
   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)
@@ -104,7 +104,7 @@ class ReraiserThreadGroup(object):
     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
@@ -113,6 +113,8 @@ class ReraiserThreadGroup(object):
     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[:]:
@@ -127,7 +129,7 @@ class ReraiserThreadGroup(object):
     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
@@ -144,7 +146,7 @@ class ReraiserThreadGroup(object):
         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: