Skip to content

Commit

Permalink
Assert that recursive logging should not occur in debug systems
Browse files Browse the repository at this point in the history
  • Loading branch information
jdksjolen committed Feb 10, 2025
1 parent b12c7a0 commit 98b6744
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/hotspot/share/logging/logAsyncWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ bool AsyncLogWriter::resort_to_synchronous_logging() {
Thread* this_thread = Thread::current_or_null();
bool is_async_log_thread = this_thread != nullptr && alw == this_thread;
bool is_recursively_logging = this_thread != nullptr && holding_thread == this_thread;
assert(!is_recursively_logging, "Do not log while holding the Async log lock");
return is_async_log_thread || // The async log producer is attempting to log, leading to recursive logging.
is_recursively_logging || // A thread enqueuing a message has attempted to log something.
alw == nullptr || // There is no AsyncLogWriter instance yet.
Expand Down

0 comments on commit 98b6744

Please sign in to comment.