Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(245)

Unified Diff: build/android/pylib/utils/timeout_retry.py

Issue 666803003: [Android] Make WithTimeoutAndRetry-decorated functions self-aware. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « build/android/pylib/device/decorators.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/pylib/utils/timeout_retry.py
diff --git a/build/android/pylib/utils/timeout_retry.py b/build/android/pylib/utils/timeout_retry.py
index bc7e891d0b15dd82088911b500d4f788ee7080cf..bae8b16cf7ffd5b16b32e849ffb1af26bf290ead 100644
--- a/build/android/pylib/utils/timeout_retry.py
+++ b/build/android/pylib/utils/timeout_retry.py
@@ -11,6 +11,10 @@ from pylib.utils import reraiser_thread
from pylib.utils import watchdog_timer
+class TimeoutRetryThread(reraiser_thread.ReraiserThread):
+ pass
+
+
def Run(func, timeout, retries, args=None, kwargs=None):
"""Runs the passed function in a separate thread with timeouts and retries.
@@ -40,7 +44,7 @@ def Run(func, timeout, retries, args=None, kwargs=None):
try:
name = 'TimeoutThread-for-%s' % threading.current_thread().name
thread_group = reraiser_thread.ReraiserThreadGroup(
- [reraiser_thread.ReraiserThread(RunOnTimeoutThread, name=name)])
+ [TimeoutRetryThread(RunOnTimeoutThread, name=name)])
thread_group.StartAll()
thread_group.JoinAll(watchdog_timer.WatchdogTimer(timeout))
return ret[0]
« no previous file with comments | « build/android/pylib/device/decorators.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698