logln("stats: " + service.stats());
// ICURWLock
ICURWLock rwlock = new ICURWLock();
rwlock.acquireRead();
rwlock.releaseRead();
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 {
rwlock.releaseRead();
errln("no error thrown");
}
catch (IllegalStateException e) {
logln("OK: " + e.getMessage());
}
try {
rwlock.releaseWrite();
errln("no error thrown");
}
catch (IllegalStateException e) {
logln("OK: " + e.getMessage());
}