Node < E > prepend ( E element ) { for ( ; ; ) { Node < E > b = predecessor ( ) ; if ( b == null ) return null ; Node < E > x = new Node < E > ( element , this , b ) ; if ( b . casNext ( this , x ) ) { setPrev ( x ) ; // optimistically link return x ; } } }
Tries to insert a node holding element as predecessor failing if no live predecessor can be found to link to .