ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/main/java/util/concurrent/ThreadPoolExecutor.java
(Generate patch)

Comparing jsr166/src/main/java/util/concurrent/ThreadPoolExecutor.java (file contents):
Revision 1.97 by dl, Sat Jul 15 14:38:20 2006 UTC vs.
Revision 1.98 by dl, Sat Jul 15 20:10:13 2006 UTC

# Line 856 | Line 856 | public class ThreadPoolExecutor extends
856          /**
857           * Runs a single task between before/after methods.
858           */
859 <        private void runTask(Runnable task) {
859 >        private void runTask(Runnable task) throws Throwable {
860              final ReentrantLock runLock = this.runLock;
861              runLock.lock();
862 +            Throwable ex = null;
863              try {
864                  /*
865                   * Ensure that unless pool is stopping, this thread
# Line 873 | Line 874 | public class ThreadPoolExecutor extends
874                      thread.interrupt();
875  
876                  beforeExecute(thread, task);
876                Throwable ex = null;
877                  try {
878                      task.run();
879                  } catch (Throwable throwable) {
880                      ex = throwable;
881                  } finally {
882                    ++completedTasks;
882                      afterExecute(task, ex);
883                  }
884              } finally {
885 +                ++completedTasks;
886                  runLock.unlock();
887 +                if (ex != null)
888 +                    throw ex;
889              }
890          }
891  
# Line 898 | Line 900 | public class ThreadPoolExecutor extends
900                      runTask(task);
901                      task = null;
902                  }
903 +            } catch (Throwable fallThrough) {
904              } finally {
905                  workerDone(this);
906              }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines