From c968a672c034fe533ea5f4ac5efe37ffb76c93e2 Mon Sep 17 00:00:00 2001 From: Casper Norrbin Date: Wed, 10 Sep 2025 13:45:06 +0000 Subject: [PATCH] 8362282: runtime/logging/StressAsyncUL.java failed with exitValue = 134 Reviewed-by: jsjolen, dholmes --- src/hotspot/share/logging/logAsyncWriter.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/hotspot/share/logging/logAsyncWriter.cpp b/src/hotspot/share/logging/logAsyncWriter.cpp index cfb6a991c4c..d184827f582 100644 --- a/src/hotspot/share/logging/logAsyncWriter.cpp +++ b/src/hotspot/share/logging/logAsyncWriter.cpp @@ -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 {