hg: jdk8/tl/jdk: 8014890: (ref) Reference queues may return more entries than expected
mandy.chung at oracle.com
mandy.chung at oracle.com
Fri Jul 12 04:21:17 PDT 2013
Changeset: 858c75eb83b5
Author: mchung
Date: 2013-07-08 14:05 +0200
URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/858c75eb83b5
8014890: (ref) Reference queues may return more entries than expected
Summary: When enqueuing references check whether the j.l.r.Reference has already been enqeued or removed in the lock. Do not enqueue them again. This occurs because multiple threads may try to enqueue the same j.l.r.Reference at the same time.
Reviewed-by: mchung, dholmes, plevart, shade
Contributed-by: thomas.schatzl at oracle.com
! src/share/classes/java/lang/ref/Reference.java
! src/share/classes/java/lang/ref/ReferenceQueue.java
+ test/java/lang/ref/EnqueuePollRace.java
More information about the serviceability-dev
mailing list