Fix SharedPromise::isFulfilled doesn't get back correct value when it's running in...
[folly.git] / folly / futures / SharedPromise-inl.h
index 185062acdbcc01afbc5fd19ee543dadcc06a4b06..9def3bc68658820600853a9380f604b9000a8cf1 100644 (file)
@@ -131,6 +131,7 @@ void SharedPromise<T>::setTry(Try<T>&& t) {
 
 template <class T>
 bool SharedPromise<T>::isFulfilled() {
+  std::lock_guard<std::mutex> g(mutex_);
   return hasValue_;
 }