856 |
|
/** |
857 |
|
* Runs a single task between before/after methods. |
858 |
|
*/ |
859 |
< |
private void runTask(Runnable task) throws Throwable { |
859 |
> |
private void runTask(Runnable task) { |
860 |
|
final ReentrantLock runLock = this.runLock; |
861 |
|
runLock.lock(); |
862 |
|
Throwable ex = null; |
884 |
|
} finally { |
885 |
|
++completedTasks; |
886 |
|
runLock.unlock(); |
887 |
< |
if (ex != null) |
888 |
< |
throw ex; |
887 |
> |
if (ex != null) { |
888 |
> |
if (ex instanceof RuntimeException) |
889 |
> |
throw (RuntimeException) ex; |
890 |
> |
else if (ex instanceof Error) |
891 |
> |
throw (Error) ex; |
892 |
> |
else |
893 |
> |
throw new Error(ex); |
894 |
> |
} |
895 |
|
} |
896 |
|
} |
897 |
|
|
906 |
|
runTask(task); |
907 |
|
task = null; |
908 |
|
} |
903 |
– |
} catch (Throwable fallThrough) { |
909 |
|
} finally { |
910 |
|
workerDone(this); |
911 |
|
} |