return false; int nextc = c-1; if (compareAndSetState(c, nextc)) return nextc == 0;
return false; int nextc = c-1; if (compareAndSetState(c, nextc)) return nextc == 0; int s = getState(); int exts = s+1; if (compareAndSetState(s, exts)) { toplatch.countDown(); return exts > 0;
final int state=getState(); if(state!=0 && (state^group)<0) return -1; if(compareAndSetState(state, state+group)) return +1; if(state==0 || (state^group)<0) throw new IllegalMonitorStateException(); if(compareAndSetState(state, state-group)) return true;
return true; while (!compareAndSetState(current, current - 1)); return 1 == current;
int c = getState(); int nextc = c + 1; if (compareAndSetState(c, nextc)) return 1; return false; int nextc = c - 1; if (compareAndSetState(c, nextc)) return nextc == 0;
if (compareAndSetState(0, 1)) { setExclusiveOwnerThread(Thread.currentThread()); return true;
return false; if(compareAndSetState(c,nextc)){ return nextc==0;