jdk/src/java.base/share/classes/java/lang/ref/Reference.java
changeset 32649 2ee9017c7597
parent 32100 8a0db19f4e84
child 32834 e1dca5fe4de3
equal deleted inserted replaced
32648:1fa861caf840 32649:2ee9017c7597
   105 
   105 
   106     /* When active:   next element in a discovered reference list maintained by GC (or this if last)
   106     /* When active:   next element in a discovered reference list maintained by GC (or this if last)
   107      *     pending:   next element in the pending list (or null if last)
   107      *     pending:   next element in the pending list (or null if last)
   108      *   otherwise:   NULL
   108      *   otherwise:   NULL
   109      */
   109      */
   110     transient private Reference<T> discovered;  /* used by VM */
   110     private transient Reference<T> discovered;  /* used by VM */
   111 
   111 
   112 
   112 
   113     /* Object used to synchronize with the garbage collector.  The collector
   113     /* Object used to synchronize with the garbage collector.  The collector
   114      * must acquire this lock at the beginning of each collection cycle.  It is
   114      * must acquire this lock at the beginning of each collection cycle.  It is
   115      * therefore critical that any code holding this lock complete as quickly
   115      * therefore critical that any code holding this lock complete as quickly
   116      * as possible, allocate no new objects, and avoid calling user code.
   116      * as possible, allocate no new objects, and avoid calling user code.
   117      */
   117      */
   118     static private class Lock { }
   118     private static class Lock { }
   119     private static Lock lock = new Lock();
   119     private static Lock lock = new Lock();
   120 
   120 
   121 
   121 
   122     /* List of References waiting to be enqueued.  The collector adds
   122     /* List of References waiting to be enqueued.  The collector adds
   123      * References to this list, while the Reference-handler thread removes
   123      * References to this list, while the Reference-handler thread removes