These changes look fine,
but I believe ReferenceQueue can benefit from more work.
- Instead of having a Lock subclass, just make lock a new Object()
- Update the queue using the CAS capabilities from java.util.concurrent.atomic.
But that would be an independent and more difficult fix.
While you'
739: (ref) ReferenceQueue.poll() doesn't scale well
6711667: (ref) Update SoftReference timestamp only if clock advances
This is forward-port from 6u14 of two scalability fixes. These were
original fixed by Tom Rodriguez in an earlier update.
The webrev is here:
http://cr.openjdk.java.net