1219 |
|
LONG_DELAY_MS, MILLISECONDS, |
1220 |
|
new ArrayBlockingQueue<Runnable>(1)); |
1221 |
|
try { p.shutdown(); } catch (SecurityException ok) { return; } |
1222 |
< |
try { |
1223 |
< |
p.execute(new NoOpRunnable()); |
1224 |
< |
shouldThrow(); |
1225 |
< |
} catch (RejectedExecutionException success) {} |
1226 |
< |
|
1227 |
< |
joinPool(p); |
1222 |
> |
try (PoolCleaner cleaner = cleaner(p)) { |
1223 |
> |
try { |
1224 |
> |
p.execute(new NoOpRunnable()); |
1225 |
> |
shouldThrow(); |
1226 |
> |
} catch (RejectedExecutionException success) {} |
1227 |
> |
} |
1228 |
|
} |
1229 |
|
|
1230 |
|
/** |
1238 |
|
new ArrayBlockingQueue<Runnable>(1), h); |
1239 |
|
|
1240 |
|
try { p.shutdown(); } catch (SecurityException ok) { return; } |
1241 |
< |
try { |
1241 |
> |
try (PoolCleaner cleaner = cleaner(p)) { |
1242 |
|
TrackedNoOpRunnable r = new TrackedNoOpRunnable(); |
1243 |
|
p.execute(r); |
1244 |
|
assertFalse(r.done); |
1245 |
– |
} finally { |
1246 |
– |
joinPool(p); |
1245 |
|
} |
1246 |
|
} |
1247 |
|
|