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.180 by jsr166, Tue Sep 12 21:38:35 2017 UTC vs.
Revision 1.181 by jsr166, Sun Sep 17 17:40:14 2017 UTC

# Line 720 | Line 720 | public class ThreadPoolExecutor extends
720       * specially.
721       */
722      private void checkShutdownAccess() {
723 +        // assert mainLock.isHeldByCurrentThread();
724          SecurityManager security = System.getSecurityManager();
725          if (security != null) {
726              security.checkPermission(shutdownPerm);
727 <            final ReentrantLock mainLock = this.mainLock;
728 <            mainLock.lock();
728 <            try {
729 <                for (Worker w : workers)
730 <                    security.checkAccess(w.thread);
731 <            } finally {
732 <                mainLock.unlock();
733 <            }
727 >            for (Worker w : workers)
728 >                security.checkAccess(w.thread);
729          }
730      }
731  
# Line 739 | Line 734 | public class ThreadPoolExecutor extends
734       * (in which case some threads may remain uninterrupted).
735       */
736      private void interruptWorkers() {
737 <        final ReentrantLock mainLock = this.mainLock;
738 <        mainLock.lock();
739 <        try {
745 <            for (Worker w : workers)
746 <                w.interruptIfStarted();
747 <        } finally {
748 <            mainLock.unlock();
749 <        }
737 >        // assert mainLock.isHeldByCurrentThread();
738 >        for (Worker w : workers)
739 >            w.interruptIfStarted();
740      }
741  
742      /**

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines