mirror of
https://github.com/Qortal/altcoinj.git
synced 2025-02-12 10:15:52 +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:
parent
c351df567e
commit
9bc9a4b262
@ -31,7 +31,7 @@ public class Locks {
|
|||||||
// Default policy goes here. If you want to change this, use one of the static methods before
|
// 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
|
// instantiating any bitcoinj objects. The policy change will take effect only on new objects
|
||||||
// from that point onwards.
|
// from that point onwards.
|
||||||
warnOnLockCycles();
|
throwOnLockCycles();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static CycleDetectingLockFactory.Policy policy;
|
private static CycleDetectingLockFactory.Policy policy;
|
||||||
@ -61,9 +61,4 @@ public class Locks {
|
|||||||
public static CycleDetectingLockFactory.Policy getPolicy() {
|
public static CycleDetectingLockFactory.Policy getPolicy() {
|
||||||
return policy;
|
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());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user