src/hotspot/share/jfr/recorder/service/jfrPostBox.cpp
changeset 59251 4cbfa5077d68
parent 58863 c16ac7a2eba4
child 59252 623722a6aeb9
equal deleted inserted replaced
59250:a6deb69743d4 59251:4cbfa5077d68
   137   return Atomic::load(&_messages) == 0;
   137   return Atomic::load(&_messages) == 0;
   138 }
   138 }
   139 
   139 
   140 int JfrPostBox::collect() {
   140 int JfrPostBox::collect() {
   141   // get pending and reset to 0
   141   // get pending and reset to 0
   142   const int messages = Atomic::xchg(0, &_messages);
   142   const int messages = Atomic::xchg(&_messages, 0);
   143   if (check_waiters(messages)) {
   143   if (check_waiters(messages)) {
   144     _has_waiters = true;
   144     _has_waiters = true;
   145     assert(JfrMsg_lock->owned_by_self(), "incrementing _msg_read_serial is protected by JfrMsg_lock");
   145     assert(JfrMsg_lock->owned_by_self(), "incrementing _msg_read_serial is protected by JfrMsg_lock");
   146     // Update made visible on release of JfrMsg_lock via fence instruction in Monitor::IUnlock.
   146     // Update made visible on release of JfrMsg_lock via fence instruction in Monitor::IUnlock.
   147     ++_msg_read_serial;
   147     ++_msg_read_serial;