MCPcopy Create free account
hub / github.com/AstroImageJ/astroimagej / startAndJoin

Method startAndJoin

ij/src/main/java/ij/util/ThreadUtil.java:11–24  ·  view source on GitHub ↗

Start all given threads and wait on each of them until all are done. From Stephan Preibisch's Multithreading.java class. See: http://repo.or.cz/w/trakem2.git?a=blob;f=mpi/fruitfly/general/MultiThreading.java;hb=HEAD @param threads

(Thread[] threads)

Source from the content-addressed store, hash-verified

9 * @param threads
10 */
11 public static void startAndJoin(Thread[] threads) {
12 for (int ithread = 0; ithread < threads.length; ++ithread) {
13 threads[ithread].setPriority(Thread.NORM_PRIORITY);
14 threads[ithread].start();
15 }
16
17 try {
18 for (int ithread = 0; ithread < threads.length; ++ithread) {
19 threads[ithread].join();
20 }
21 } catch (InterruptedException ie) {
22 throw new RuntimeException(ie);
23 }
24 }
25
26 public static Thread[] createThreadArray(int nb) {
27 if (nb == 0) {

Callers 2

filterMethod · 0.95
blur1DirectionMethod · 0.95

Calls 5

startMethod · 0.95
joinAllMethod · 0.95
joinMethod · 0.80
callMethod · 0.45
handleExceptionMethod · 0.45

Tested by

no test coverage detected