You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We came across the reentrant_spin_lock data structure and seemed to find a potential data race. We may have missed something but just want to report it anyway.
So in the try_lock() or lock() method, they call the try_taken_lock() method, which calls the is_taken() method to check whether the current is holding the lock already. However, it doesn't seem to read the m_OwnerId variable with synchronization/happens-before, and the m_OwnerId variable is not marked as atomic variable. So while a thread is calling try_lock() which reads m_OwnerId, another thread can concurrently writes m_OwnerId, which seems like data race.
So should m_OwnerId be declared as atomic variable according to C++11?
The text was updated successfully, but these errors were encountered:
Hi guys,
We came across the reentrant_spin_lock data structure and seemed to find a potential data race. We may have missed something but just want to report it anyway.
So in the try_lock() or lock() method, they call the try_taken_lock() method, which calls the is_taken() method to check whether the current is holding the lock already. However, it doesn't seem to read the m_OwnerId variable with synchronization/happens-before, and the m_OwnerId variable is not marked as atomic variable. So while a thread is calling try_lock() which reads m_OwnerId, another thread can concurrently writes m_OwnerId, which seems like data race.
So should m_OwnerId be declared as atomic variable according to C++11?
The text was updated successfully, but these errors were encountered: