Review Request JDK-8175797: (ref) Reference::enqueue method should clear referent before enqueuing

Mandy Chung mandy.chung at oracle.com
Tue Mar 7 15:35:43 UTC 2017


This proposes to update Reference::enqueue method to clear this reference
object before enqueuing it to the registered queue consistent with what 
the garbage collector does that clears the reference object before putting
it in the pending queue for enqueuing.  It has been a common pattern that
Reference::clear is called before or after enqueuing.  I consider this
a follow-up to JDK-8071507 that soft, weak, phantom references are 
automatically cleared references when implicitly or explicitly enqueued.

Webrev at:
  http://cr.openjdk.java.net/~mchung/jdk9/webrevs/8175797/webrev.00/index.html

Thanks
Mandy


More information about the core-libs-dev mailing list