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

Unified Diff: build/android/devil/utils/reraiser_thread.py

Issue 1415533007: [Android] Add sharding for AMP instrumentation tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed rnephew's comments. Created 5 years, 1 month 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
Index: build/android/devil/utils/reraiser_thread.py
diff --git a/build/android/devil/utils/reraiser_thread.py b/build/android/devil/utils/reraiser_thread.py
index e108fc754fbe9befd62c25dfe1e68f97ef071161..dbaa1ea0d7fe72f25e0c3f3a5b669f870f553669 100644
--- a/build/android/devil/utils/reraiser_thread.py
+++ b/build/android/devil/utils/reraiser_thread.py
@@ -226,3 +226,13 @@ def RunAsync(funcs, watcher=None):
thread_group = ReraiserThreadGroup(ReraiserThread(f) for f in funcs)
thread_group.StartAll(will_block=True)
return thread_group.GetAllReturnValues(watcher=watcher)
+
+def RunThreadsSync(threads):
jbudorick 2015/11/17 18:04:46 There's no reason why both this and RunAsync shoul
mikecase (-- gone --) 2015/11/19 01:35:37 Added support to RunAsync to pass args and kwargs
+ """Runs the given threads in parallel and blocks until all threads finish.
+
+ Args:
+ threads: List of reraiser_thread objects.
+ """
+ workers = ReraiserThreadGroup(threads)
+ workers.StartAll()
+ workers.JoinAll()

Powered by Google App Engine
This is Rietveld 408576698