13301331133213331334133513361337133813391340
if (change == null) result = treeValue; else result = change.applyTo(treeValue); size.increment(result); return true; } }); for (OSBTreeRidBag.Change change : notAppliedChanges.values()) {
13361337133813391340134113421343134413451346
return true; } }); for (OSBTreeRidBag.Change change : notAppliedChanges.values()) { size.increment(change.applyTo(0)); } return size.intValue(); }
629630631632633634635636637638639
} else { OModifiableInteger counter = newEntries.get(identifiable); if (counter == null) newEntries.put(identifiable, new OModifiableInteger(1)); else counter.increment(); } if (size >= 0) size++;
6566676869707172737475
final OModifiableInteger lHolds = lockHolds.get(); final int holds = lHolds.intValue(); if (holds > 0) { // we have already acquire read lock lHolds.increment(); return; } else if (holds < 0) { // write lock is acquired before, do nothing return; }
9293949596979899100101102
threadCountersHashTable.increment(); wNode = tail.get(); } lHolds.increment(); assert lHolds.intValue() == 1; } public void releaseReadLock() { final OModifiableInteger lHolds = lockHolds.get();
149150151152153154155156157158159
public void releaseWriteLock() { final OModifiableInteger lHolds = lockHolds.get(); if (lHolds.intValue() < -1) { lHolds.increment(); return; } setExclusiveOwnerThread(null);
172173174175176177178179180181182
} myNode.set(predNode.get()); predNode.set(null); lHolds.increment(); assert lHolds.intValue() == 0; } private final static class WNode { private final Queue<Thread> waitingReaders = new ConcurrentLinkedQueue<Thread>();