3
0
mirror of https://github.com/Qortal/altcoinj.git synced 2025-02-07 23:03:04 +00:00

For now, throw on cycles. Also remove checkNotLocked(), as it isn't actually the right thing to do.

This commit is contained in:
Mike Hearn 2013-03-11 16:07:33 +01:00
parent c351df567e
commit 9bc9a4b262

View File

@ -31,7 +31,7 @@ public class Locks {
// Default policy goes here. If you want to change this, use one of the static methods before
// instantiating any bitcoinj objects. The policy change will take effect only on new objects
// from that point onwards.
warnOnLockCycles();
throwOnLockCycles();
}
private static CycleDetectingLockFactory.Policy policy;
@ -61,9 +61,4 @@ public class Locks {
public static CycleDetectingLockFactory.Policy getPolicy() {
return policy;
}
/** Equivalent to checkState(!lock.isLocked()) but the English description makes it harder to overlook the ! */
public static void checkNotLocked(ReentrantLock lock) {
checkState(!lock.isLocked());
}
}