public void clear() { try { wr_.acquire(); try { c_.clear(); } finally { wr_.release(); } } catch (InterruptedException ex) { Thread.currentThread().interrupt(); throw new UnsupportedOperationException(); } }
public Object remove(Object key) { try { wr_.acquire(); try { return c_.remove(key); } finally { wr_.release(); } } catch (InterruptedException ex) { Thread.currentThread().interrupt(); throw new UnsupportedOperationException(); } }
/** Clean up after a reader operation * */ protected void afterRead(boolean wasInterrupted) { if (wasInterrupted) { Thread.currentThread().interrupt(); } else rd_.release(); }
public void unlock() { sync.release(1); }