ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/test/tck/AbstractExecutorServiceTest.java
(Generate patch)

Comparing jsr166/src/test/tck/AbstractExecutorServiceTest.java (file contents):
Revision 1.40 by jsr166, Sun Oct 4 18:18:48 2015 UTC vs.
Revision 1.41 by jsr166, Mon Oct 5 22:54:45 2015 UTC

# Line 194 | Line 194 | public class AbstractExecutorServiceTest
194          final CountDownLatch quittingTime = new CountDownLatch(1);
195          final Callable<Void> awaiter = new CheckedCallable<Void>() {
196              public Void realCall() throws InterruptedException {
197 <                quittingTime.await();
197 >                assertTrue(quittingTime.await(2*LONG_DELAY_MS, MILLISECONDS));
198                  return null;
199              }};
200          final ExecutorService p
201              = new ThreadPoolExecutor(1,1,60, TimeUnit.SECONDS,
202                                       new ArrayBlockingQueue<Runnable>(10));
203 <        try (PoolCleaner cleaner = cleaner(p)) {
204 <            Thread t = new Thread(new CheckedInterruptedRunnable() {
203 >        try (PoolCleaner cleaner = cleaner(p, quittingTime)) {
204 >            Thread t = newStartedThread(new CheckedInterruptedRunnable() {
205                  public void realRun() throws Exception {
206                      Future<Void> future = p.submit(awaiter);
207                      submitted.countDown();
208                      future.get();
209                  }});
210 <            t.start();
211 <            submitted.await();
210 >
211 >            await(submitted);
212              t.interrupt();
213 <            t.join();
214 <            quittingTime.countDown();
213 >            awaitTermination(t);
214          }
215      }
216  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines