Add missing acquire_load to call_once overload.
Summary: Seemed to have been overlooked in D24028.
This bug was found and brought to my attention by Paul Wankadia.
Reviewers: kubamracek, EricWF, dvyukov
Differential Revision: https://reviews.llvm.org/D32402
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@301132 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/include/mutex b/include/mutex
index e92baa5..0b25614 100644
--- a/include/mutex
+++ b/include/mutex
@@ -685,7 +685,7 @@
void
call_once(once_flag& __flag, const _Callable& __func)
{
- if (__flag.__state_ != ~0ul)
+ if (__libcpp_acquire_load(&__flag.__state_) != ~0ul)
{
__call_once_param<const _Callable> __p(__func);
__call_once(__flag.__state_, &__p, &__call_once_proxy<const _Callable>);