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

Comparing jsr166/src/jsr166e/ForkJoinTask.java (file contents):
Revision 1.15 by jsr166, Mon Jul 22 16:52:31 2013 UTC vs.
Revision 1.16 by dl, Fri Sep 20 10:52:13 2013 UTC

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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines