mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 14:54:52 +02:00
8203327: Small cleanups in java.lang.ref
Reviewed-by: mr
This commit is contained in:
parent
d2dd37cf1f
commit
e85e0f5daf
1 changed files with 5 additions and 5 deletions
|
@ -43,17 +43,17 @@ public class ReferenceQueue<T> {
|
|||
*/
|
||||
public ReferenceQueue() { }
|
||||
|
||||
private static class Null<S> extends ReferenceQueue<S> {
|
||||
boolean enqueue(Reference<? extends S> r) {
|
||||
private static class Null extends ReferenceQueue<Object> {
|
||||
boolean enqueue(Reference<?> r) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
static ReferenceQueue<Object> NULL = new Null<>();
|
||||
static ReferenceQueue<Object> ENQUEUED = new Null<>();
|
||||
static final ReferenceQueue<Object> NULL = new Null();
|
||||
static final ReferenceQueue<Object> ENQUEUED = new Null();
|
||||
|
||||
private static class Lock { };
|
||||
private Lock lock = new Lock();
|
||||
private final Lock lock = new Lock();
|
||||
private volatile Reference<? extends T> head;
|
||||
private long queueLength = 0;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue