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 |
|
|
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) { |