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

Comparing jsr166/src/main/java/util/concurrent/ForkJoinPool.java (file contents):
Revision 1.384 by jsr166, Thu Nov 12 22:54:33 2020 UTC vs.
Revision 1.385 by dl, Fri Nov 13 15:24:36 2020 UTC

# Line 1661 | Line 1661 | public class ForkJoinPool extends Abstra
1661                  return -1;
1662              else if ((int)(ctl >> RC_SHIFT) > ac)
1663                  Thread.onSpinWait();         // signal in progress
1664 <            else if (!(alt = !alt)) {        // check between park calls
1665 <                if (!Thread.interrupted() && deadline != 0L &&
1666 <                    deadline - System.currentTimeMillis() <= TIMEOUT_SLOP &&
1667 <                    compareAndSetCtl(c, ((UC_MASK & (c - TC_UNIT)) |
1668 <                                         (w.stackPred & SP_MASK)))) {
1669 <                    w.phase = QUIET;
1670 <                    return -1;               // drop on timeout
1671 <                }
1672 <            }
1664 >            else if (deadline != 0L &&
1665 >                     deadline - System.currentTimeMillis() <= TIMEOUT_SLOP) {
1666 >                if (c != (c = ctl))          // ensure consistent
1667 >                    ac = (int)(c >> RC_SHIFT);
1668 >                else if (compareAndSetCtl(c, ((UC_MASK & (c - TC_UNIT)) |
1669 >                                              (w.stackPred & SP_MASK)))) {
1670 >                    w.phase = QUIET;
1671 >                    return -1;               // drop on timeout
1672 >                }
1673 >            }
1674 >            else if (!(alt = !alt))          // check between park calls
1675 >                Thread.interrupted();
1676              else if (deadline != 0L)
1677                  LockSupport.parkUntil(deadline);
1678 <            else
1678 >            else
1679                  LockSupport.park();
1680          }
1681          LockSupport.setCurrentBlocker(null);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines