void waitFor(int state) { synchronized (progressLock) { while (progressState < state) { try {
progressLock.wait();
} catch (InterruptedException e) { thrownew Error("unexpected InterruptedException", e);
}
} if (progressState > state) { thrownew Error("unexpected test state change, state = " + state + ", progressState = " + progressState);
}
}
}
/** *Loopsrunningtestuntilsomesortofanexceptionorerror, *expectstoseeThreadDeath.
*/ publicvoid run() { try { // Print before state change, so that other thread is most likely // to see this thread executing calls to test() in a loop.
System.out.println("thread running");
toState(RUNNING); while (true) { // (2,2) (2,10) (2,100) were observed to tickle the bug;
test(2, 100);
}
} catch (ThreadDeath e) { // nothing to say, passing was incremented by the test.
} catch (Throwable e) { thrownew Error("unexpected Throwable " + e, e);
}
toState(STOPPING);
}
publicstaticvoid main(String[] args) throws Exception { // Warm up "test" // t will never be started. for (int n = 0; n < 11000; n++) {
test(2, 100);
}
var method = Test8004741.class.getDeclaredMethod("test", int.class, int.class); if (!WhiteBox.getWhiteBox().isMethodCompiled(method)) { thrownew Error("test method didn't get compiled");
}
/* Test repetitions. If the test succeeds-mostly, it succeeds, *aslongasitdoesnotcrash(theoutcomeiftheexceptionrange *tableentryforthearrayallocationismissing).
*/
passed = 0; int limit = 6; while (passed != limit) {
threadTest();
}
}
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.11 Sekunden
(vorverarbeitet am 2026-10-01)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.