8362282: runtime/logging/StressAsyncUL.java failed with exitValue = 134

Reviewed-by: jsjolen, dholmes
This commit is contained in:
Casper Norrbin 2025-09-10 13:45:06 +00:00
parent 385c132989
commit c968a672c0

View File

@ -318,13 +318,13 @@ void AsyncLogWriter::initialize() {
AsyncLogWriter* self = new AsyncLogWriter();
if (self->_initialized) {
Atomic::release_store_fence(&AsyncLogWriter::_instance, self);
// All readers of _instance after the fence see non-null.
// We use LogOutputList's RCU counters to ensure all synchronous logsites have completed.
// After that, we start AsyncLog Thread and it exclusively takes over all logging I/O.
// After that, we publish the initalized _instance to readers.
// Then we start the AsyncLog Thread and it exclusively takes over all logging I/O.
for (LogTagSet* ts = LogTagSet::first(); ts != nullptr; ts = ts->next()) {
ts->wait_until_no_readers();
}
Atomic::release_store_fence(&AsyncLogWriter::_instance, self);
os::start_thread(self);
log_debug(logging, thread)("Async logging thread started.");
} else {