Home | History | Annotate | Download | only in bugs

Lines Matching defs:threads

25         ExecutorService threads = Executors.newCachedThreadPool();
32 // execute verySlowMethod twice in separate threads
34 threads.execute(new ServiceRunner(service));
35 threads.execute(new ServiceRunner(service));
37 // waiting for threads to finish
39 threads.shutdown();
41 if (!threads.awaitTermination(1000, TimeUnit.MILLISECONDS)) {
42 // threads were timed-out
51 ExecutorService threads = Executors.newCachedThreadPool();
59 // execute verySlowMethod twice in separate threads
61 threads.execute(new ServiceRunner(service1));
62 threads.execute(new ServiceRunner(service2));
64 // waiting for threads to finish
66 threads.shutdown();
68 if (!threads.awaitTermination(500, TimeUnit.MILLISECONDS)) {
69 // threads were timed-out