Fix SharedPromise::isFulfilled doesn't get back correct value when it's running in...
[folly.git] / folly / futures / SharedPromise-inl.h
index 185062a..9def3bc 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_;
 }