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

Comparing jsr166/src/main/java/util/concurrent/ScheduledThreadPoolExecutor.java (file contents):
Revision 1.99 by jsr166, Fri Nov 20 19:54:03 2015 UTC vs.
Revision 1.100 by jsr166, Fri Nov 20 20:49:49 2015 UTC

# Line 250 | Line 250 | public class ScheduledThreadPoolExecutor
250          }
251  
252          public boolean cancel(boolean mayInterruptIfRunning) {
253 +            // The racy read of heapIndex below is benign:
254 +            // if heapIndex < 0, then OOTA guarantees that we have surely
255 +            // been removed; else we recheck under lock in remove()
256              boolean cancelled = super.cancel(mayInterruptIfRunning);
257              if (cancelled && removeOnCancel && heapIndex >= 0)
258                  remove(this);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines