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

Kim Barrett kim.barrett at
Tue Mar 7 23:31:48 UTC 2017

> On Mar 7, 2017, at 10:35 AM, Mandy Chung <mandy.chung at> wrote:
> 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:
> Thanks
> Mandy

looks good.

More information about the core-libs-dev mailing list