Created
April 25, 2014 00:53
-
-
Save rnewman/11274562 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void expectNoPermits(String method) { | |
final int availablePermits = writeLock.availablePermits(); | |
if (availablePermits != 0) { | |
throw new RuntimeException(method + " has " + availablePermits + " permits. Expected 0."); | |
} | |
} | |
private boolean setMostRecentlyUsedWithinRead(FaviconCacheElement element) { | |
expectNoPermits("setMostRecentlyUsedWithinRead"); | |
reorderingSemaphore.acquireUninterruptibly(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment