================ Comment at: src/mutex.cpp:255-267 @@ -254,9 +254,9 @@ #endif // _LIBCPP_NO_EXCEPTIONS - flag = 1; + __libcpp_atomic_store(&flag, 1, _AO_Relaxed); pthread_mutex_unlock(&mut); func(arg); pthread_mutex_lock(&mut); - flag = ~0ul; + __libcpp_atomic_store(&flag, ~0ul, _AO_Relaxed); pthread_mutex_unlock(&mut); pthread_cond_broadcast(&cv); #ifndef _LIBCPP_NO_EXCEPTIONS
@@ -264,5 +264,5 @@ catch (...) { pthread_mutex_lock(&mut); - flag = 0ul; + __libcpp_atomic_store(&flag, 0ul, _AO_Relaxed); pthread_mutex_unlock(&mut); ---------------- Can you please leave a note that says that these relaxed stores pair with the relaxed load in the header? The atomic nature of the stores look superfluous because they are performed under the mutex. http://reviews.llvm.org/D10406 EMAIL PREFERENCES http://reviews.llvm.org/settings/panel/emailpreferences/ _______________________________________________ cfe-commits mailing list cfe-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits