Skip to content

Commit

Permalink
8288904: Incorrect memory ordering in UL
Browse files Browse the repository at this point in the history
Reviewed-by: rehn, dholmes
  • Loading branch information
jdksjolen authored and David Holmes committed Jul 30, 2022
1 parent 470c0eb commit 3579024
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/hotspot/share/logging/logOutputList.cpp
Expand Up @@ -43,9 +43,12 @@ jint LogOutputList::decrease_readers() {

void LogOutputList::wait_until_no_readers() const {
OrderAccess::storeload();
while (_active_readers != 0) {
while (Atomic::load(&_active_readers) != 0) {
// Busy wait
}
// Prevent mutations to the output list to float above the active reader check.
// Such a reordering would lead to readers loading faulty data.
OrderAccess::loadstore();
}

void LogOutputList::set_output_level(LogOutput* output, LogLevelType level) {
Expand Down

1 comment on commit 3579024

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.