Sentinel
Sentinel copied to clipboard
InitExecutor may repeat "doInit"
InitExecutor#doInit() may be executed repeatedly.
we can do this to avoid repeat doInit.
private static AtomicBoolean initialized = new AtomicBoolean(false);
...
public static void doInit() {
if (!initialized.compareAndSet(false, true)) {
return;
}
...
}
Thanks for reporting!
it only happen in staic { }. is it a NotThreadSafe ? It is ThreadSafe