Release a read lock and return. An error will be thrown if a read lock is not currently held.
If this is the last active reader, notify the oldest waiting writer. Call when finished with work controlled by acquireRead.
879880881882883884885886887888889
// ICURWLock ICURWLock rwlock = new ICURWLock(); rwlock.acquireRead(); rwlock.releaseRead(); rwlock.acquireWrite(); rwlock.releaseWrite(); logln("stats: " + rwlock.getStats()); logln("stats: " + rwlock.clearStats());
886887888889890891892893894895896
rwlock.acquireWrite(); rwlock.releaseWrite(); logln("stats: " + rwlock.getStats()); logln("stats: " + rwlock.clearStats()); rwlock.acquireRead(); rwlock.releaseRead(); rwlock.acquireWrite(); rwlock.releaseWrite(); logln("stats: " + rwlock.getStats()); try {
892893894895896897898899900901902
rwlock.acquireWrite(); rwlock.releaseWrite(); logln("stats: " + rwlock.getStats()); try { rwlock.releaseRead(); errln("no error thrown"); } catch (IllegalStateException e) { logln("OK: " + e.getMessage()); }