395 |
|
final Throwable ex; |
396 |
|
ExceptionNode next; |
397 |
|
final long thrower; // use id not ref to avoid weak cycles |
398 |
+ |
final int hashCode; // store task hashCode before weak ref disappears |
399 |
|
ExceptionNode(ForkJoinTask<?> task, Throwable ex, ExceptionNode next) { |
400 |
|
super(task, exceptionTableRefQueue); |
401 |
|
this.ex = ex; |
402 |
|
this.next = next; |
403 |
|
this.thrower = Thread.currentThread().getId(); |
404 |
+ |
this.hashCode = System.identityHashCode(task); |
405 |
|
} |
406 |
|
} |
407 |
|
|
563 |
|
private static void expungeStaleExceptions() { |
564 |
|
for (Object x; (x = exceptionTableRefQueue.poll()) != null;) { |
565 |
|
if (x instanceof ExceptionNode) { |
566 |
< |
ForkJoinTask<?> key = ((ExceptionNode)x).get(); |
566 |
> |
int hashCode = ((ExceptionNode)x).hashCode; |
567 |
|
ExceptionNode[] t = exceptionTable; |
568 |
< |
int i = System.identityHashCode(key) & (t.length - 1); |
568 |
> |
int i = hashCode & (t.length - 1); |
569 |
|
ExceptionNode e = t[i]; |
570 |
|
ExceptionNode pred = null; |
571 |
|
while (e != null) { |