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

Comparing jsr166/src/main/java/util/concurrent/CyclicBarrier.java (file contents):
Revision 1.58 by jsr166, Tue Dec 20 22:37:31 2016 UTC vs.
Revision 1.59 by jsr166, Fri Feb 1 18:26:06 2019 UTC

# Line 185 | Line 185 | public class CyclicBarrier {
185  
186              int index = --count;
187              if (index == 0) {  // tripped
188 <                boolean ranAction = false;
189 <                try {
190 <                    final Runnable command = barrierCommand;
191 <                    if (command != null)
188 >                Runnable command = barrierCommand;
189 >                if (command != null) {
190 >                    try {
191                          command.run();
192 <                    ranAction = true;
194 <                    nextGeneration();
195 <                    return 0;
196 <                } finally {
197 <                    if (!ranAction)
192 >                    } catch (Throwable ex) {
193                          breakBarrier();
194 +                        throw ex;
195 +                    }
196                  }
197 +                nextGeneration();
198 +                return 0;
199              }
200  
201              // loop until tripped, broken, interrupted, or timed out

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines