Browse Source

MDEV-18043 data race in os_event

os_event::is_set(): protect os_event::m_set with os_event::mutex
pull/1079/head
Eugene Kosov 7 years ago
committed by Sergey Vojtovich
parent
commit
ed166f53fa
  1. 7
      storage/innobase/os/os0event.cc

7
storage/innobase/os/os0event.cc

@ -126,7 +126,10 @@ struct os_event {
/** @return true if the event is in the signalled state. */
bool is_set() const UNIV_NOTHROW
{
return(m_set);
mutex.enter();
bool is_set = m_set;
mutex.exit();
return is_set;
}
private:
@ -224,7 +227,7 @@ private:
int64_t signal_count; /*!< this is incremented
each time the event becomes
signaled */
EventMutex mutex; /*!< this mutex protects
mutable EventMutex mutex; /*!< this mutex protects
the next fields */

Loading…
Cancel
Save