Skip to content

Instantly share code, notes, and snippets.

@rnewman
Created April 25, 2014 00:53
Show Gist options
  • Save rnewman/11274562 to your computer and use it in GitHub Desktop.
Save rnewman/11274562 to your computer and use it in GitHub Desktop.
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