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

Side by Side 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 unified diff | Download patch
OLDNEW
1 # Copyright 2013 The Chromium Authors. All rights reserved. 1 # Copyright 2013 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 """Thread and ThreadGroup that reraise exceptions on the main thread.""" 5 """Thread and ThreadGroup that reraise exceptions on the main thread."""
6 # pylint: disable=W0212 6 # pylint: disable=W0212
7 7
8 import logging 8 import logging
9 import sys 9 import sys
10 import threading 10 import threading
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 Args: 219 Args:
220 funcs: List of functions to perform on their own threads. 220 funcs: List of functions to perform on their own threads.
221 watcher: Watchdog object providing timeout, by default waits forever. 221 watcher: Watchdog object providing timeout, by default waits forever.
222 222
223 Returns: 223 Returns:
224 A list of return values in the order of the given functions. 224 A list of return values in the order of the given functions.
225 """ 225 """
226 thread_group = ReraiserThreadGroup(ReraiserThread(f) for f in funcs) 226 thread_group = ReraiserThreadGroup(ReraiserThread(f) for f in funcs)
227 thread_group.StartAll(will_block=True) 227 thread_group.StartAll(will_block=True)
228 return thread_group.GetAllReturnValues(watcher=watcher) 228 return thread_group.GetAllReturnValues(watcher=watcher)
229
230 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
231 """Runs the given threads in parallel and blocks until all threads finish.
232
233 Args:
234 threads: List of reraiser_thread objects.
235 """
236 workers = ReraiserThreadGroup(threads)
237 workers.StartAll()
238 workers.JoinAll()
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698