public void unlock(Object name) { Monitor lock; synchronized (stringLocks) { lock = stringLocks.getUnchecked(name); } lock.leave(); }
public boolean tryLock(Object name) { Monitor lock; synchronized (stringLocks) { lock = stringLocks.getUnchecked(name); } return lock.tryEnter(); }
@Override public void testStarted() { monitor = new Monitor(); ref = new AtomicReference<>(); }
@Override public Monitor load(Object key) throws Exception { return new Monitor(); }