We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 470c0eb commit 3579024Copy full SHA for 3579024
src/hotspot/share/logging/logOutputList.cpp
@@ -43,9 +43,12 @@ jint LogOutputList::decrease_readers() {
43
44
void LogOutputList::wait_until_no_readers() const {
45
OrderAccess::storeload();
46
- while (_active_readers != 0) {
+ while (Atomic::load(&_active_readers) != 0) {
47
// Busy wait
48
}
49
+ // Prevent mutations to the output list to float above the active reader check.
50
+ // Such a reordering would lead to readers loading faulty data.
51
+ OrderAccess::loadstore();
52
53
54
void LogOutputList::set_output_level(LogOutput* output, LogLevelType level) {
0 commit comments