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

Comparing jsr166/src/jdk7/java/util/concurrent/ForkJoinTask.java (file contents):
Revision 1.7 by jsr166, Sat Jul 20 20:25:44 2013 UTC vs.
Revision 1.8 by dl, Fri Sep 20 10:52:10 2013 UTC

# Line 410 | Line 410 | public abstract class ForkJoinTask<V> im
410          final Throwable ex;
411          ExceptionNode next;
412          final long thrower;  // use id not ref to avoid weak cycles
413 +        final int hashCode;  // store task hashCode before weak ref disappears
414          ExceptionNode(ForkJoinTask<?> task, Throwable ex, ExceptionNode next) {
415              super(task, exceptionTableRefQueue);
416              this.ex = ex;
417              this.next = next;
418              this.thrower = Thread.currentThread().getId();
419 +            this.hashCode = System.identityHashCode(task);
420          }
421      }
422  
# Line 576 | Line 578 | public abstract class ForkJoinTask<V> im
578      private static void expungeStaleExceptions() {
579          for (Object x; (x = exceptionTableRefQueue.poll()) != null;) {
580              if (x instanceof ExceptionNode) {
581 <                ForkJoinTask<?> key = ((ExceptionNode)x).get();
581 >                int hashCode = ((ExceptionNode)x).hashCode;
582                  ExceptionNode[] t = exceptionTable;
583 <                int i = System.identityHashCode(key) & (t.length - 1);
583 >                int i = hashCode & (t.length - 1);
584                  ExceptionNode e = t[i];
585                  ExceptionNode pred = null;
586                  while (e != null) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines