jfb accepted this revision. jfb added inline comments. This revision is now accepted and ready to land.
================ Comment at: libcxx/include/future:556 bool __has_value() const {return (__state_ & __constructed) || (__exception_ != nullptr);} ---------------- I'm not auditing everything, but it seems like code above can still access __state_ without holding __mut_? Like in the dtor. Generally this patch lgtm because it's a step forward, but maybe we should separately refactor the code to make it so that accesses to __state_ require passing in a reference to lock_guard to show we actually hold __mut_. It would ignore that reference, but that's a way to enforce, in the type system, that __state_ is only touched when the lock is held. WDYT? Repository: rCXX libc++ https://reviews.llvm.org/D51170 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits