diff -r a6deb69743d4 -r 4cbfa5077d68 src/hotspot/share/jfr/recorder/service/jfrPostBox.cpp --- a/src/hotspot/share/jfr/recorder/service/jfrPostBox.cpp Mon Nov 25 12:32:07 2019 +0100 +++ b/src/hotspot/share/jfr/recorder/service/jfrPostBox.cpp Mon Nov 25 12:32:40 2019 +0100 @@ -139,7 +139,7 @@ int JfrPostBox::collect() { // get pending and reset to 0 - const int messages = Atomic::xchg(0, &_messages); + const int messages = Atomic::xchg(&_messages, 0); if (check_waiters(messages)) { _has_waiters = true; assert(JfrMsg_lock->owned_by_self(), "incrementing _msg_read_serial is protected by JfrMsg_lock");