private void throwError(long oldState, int arrayIndex, String type) { long newState = state.get(); if (casLog != null) { casLog.dumpLog(true); } String msg = "Unexpected " + type + " at " + arrayIndex + "; state was " + toString(oldState) + ", now " + toString(newState); LOG.info(msg); throw new AssertionError(msg); }
public synchronized void dumpLog(boolean doSleep) { if (doSleep) { try { Thread.sleep(100); } catch (InterruptedException e) { } } int logSize = (int)offset.get(); // TODO: dump the end if wrapping around? for (int i = 0; i < logSize; ++i) { LOG.info("CAS history dump: " + FixedSizedObjectPool.toString(log[i << 1]) + " => " + FixedSizedObjectPool.toString(log[(i << 1) + 1])); } offset.set(0); } }
private void throwError(long oldState, int arrayIndex, String type) { long newState = state.get(); if (casLog != null) { casLog.dumpLog(true); } String msg = "Unexpected " + type + " at " + arrayIndex + "; state was " + toString(oldState) + ", now " + toString(newState); LOG.info(msg); throw new AssertionError(msg); }
public synchronized void dumpLog(boolean doSleep) { if (doSleep) { try { Thread.sleep(100); } catch (InterruptedException e) { } } int logSize = (int)offset.get(); // TODO: dump the end if wrapping around? for (int i = 0; i < logSize; ++i) { LOG.info("CAS history dump: " + FixedSizedObjectPool.toString(log[i << 1]) + " => " + FixedSizedObjectPool.toString(log[(i << 1) + 1])); } offset.set(0); } }