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
Both the last released version 8.7 and the current master branch (2038ab1) have an incorrect order of the release fence and pointer store operations when creating the object.
The current current code is
T *newObject = m_objectFactory();
s_pObject.store(newObject, std::memory_order_relaxed);
std::atomic_thread_fence(std::memory_order_release);
however the correct sequence, which is also described in the article linked from the function documentation, should be
T *newObject = m_objectFactory();
std::atomic_thread_fence(std::memory_order_release);
s_pObject.store(newObject, std::memory_order_relaxed);
Otherwise there is no guarantee that the object content will be already fully stored in the memory when another thread might see the pointer and attempt to access it.
The text was updated successfully, but these errors were encountered:
Both the last released version 8.7 and the current master branch (2038ab1) have an incorrect order of the release fence and pointer store operations when creating the object.
The current current code is
however the correct sequence, which is also described in the article linked from the function documentation, should be
Otherwise there is no guarantee that the object content will be already fully stored in the memory when another thread might see the pointer and attempt to access it.
The text was updated successfully, but these errors were encountered: