-
Bug
-
Resolution: Fixed
-
P3
-
6
-
b06
-
generic
-
generic
-
Verified
AbstractQueuedSynchronizer and AbstractQueuedLongSynchronizer
handle exceptions during acquire like this
try { ... }
catch (RuntimeException e) { handle(); throw e; }
This fails to handle errors or other pathological throwables
(e.g. a checked Exception can always be thrown using Thread.stop(Throwable))
More robust and clear is to use the idiom
boolean failed = true;
try { ... ; failed = false; }
finally { if (failed) handle(); }
handle exceptions during acquire like this
try { ... }
catch (RuntimeException e) { handle(); throw e; }
This fails to handle errors or other pathological throwables
(e.g. a checked Exception can always be thrown using Thread.stop(Throwable))
More robust and clear is to use the idiom
boolean failed = true;
try { ... ; failed = false; }
finally { if (failed) handle(); }
- relates to
-
JDK-6450211 ThreadPoolExecutor.afterExecute sees RuntimeExceptions, but not Errors
-
- Closed
-