private Holder createHolder ( ) { poll ( ) ; Holder holder = new Holder ( queue ) ; WeakReference < Holder > ref = new WeakReference <> ( holder ) ; Holder old ; do { old = strongRefs ; holder . next = old ; } while ( ! strongRefsUpdater . compareAndSet ( this , old , holder ) ) ; local . set ( ref ) ; return holder ; }
Creates a new holder object and registers it appropriately . Also polls for thread - exits .