private final void contendedLock(){
  boolean waiting=false;
  for (int s; ; ) {
    if (((s=lockState) & WRITER) == 0) {
      if (U.compareAndSwapInt(this,LOCKSTATE,s,WRITER)) {
        if (waiting)         waiter=null;
        return;
      }
    }
 else     if ((s | WAITER) == 0) {
      if (U.compareAndSwapInt(this,LOCKSTATE,s,s | WAITER)) {
        waiting=true;
        waiter=Thread.currentThread();
      }
    }
 else     if (waiting)     LockSupport.park(this);
  }
}

private final void contendedLock ( ) { boolean waiting = false ; for ( int s ; ; ) { if ( ( ( s = lockState ) & WRITER ) == 0 ) { if ( U . compareAndSwapInt ( this , LOCKSTATE , s , WRITER ) ) { if ( waiting ) waiter = null ; return ; } } else if ( ( s | WAITER ) == 0 ) { if ( U . compareAndSwapInt ( this , LOCKSTATE , s , s | WAITER ) ) { waiting = true ; waiter = Thread . currentThread ( ) ; } } else if ( waiting ) LockSupport . park ( this ) ; } }
possibly blocks awaiting root lock .
