// detachPromise() and setResult() should never be called in parallel
// so we don't need to protect this.
if (UNLIKELY(!result_)) {
- setResult(Try<T>(exception_wrapper(BrokenPromise())));
+ setResult(Try<T>(exception_wrapper(BrokenPromise(typeid(T).name()))));
}
detachOne();
}
x->add([this]() mutable {
SCOPE_EXIT { detachOne(); };
RequestContext::setContext(context_);
+ SCOPE_EXIT { callback_ = {}; };
callback_(std::move(*result_));
});
} else {
x->addWithPriority([this]() mutable {
SCOPE_EXIT { detachOne(); };
RequestContext::setContext(context_);
+ SCOPE_EXIT { callback_ = {}; };
callback_(std::move(*result_));
}, priority);
}
--attached_; // Account for extra ++attached_ before try
RequestContext::setContext(context_);
result_ = Try<T>(exception_wrapper(std::current_exception()));
+ SCOPE_EXIT { callback_ = {}; };
callback_(std::move(*result_));
}
} else {
RequestContext::setContext(context_);
+ SCOPE_EXIT { callback_ = {}; };
callback_(std::move(*result_));
}
}
std::move(*std::get<sizeof...(ts2)>(o)));
}
- static std::tuple<Ts...> unwrap(std::tuple<folly::Try<Ts>...>&& o,
+ static std::tuple<Ts...> unwrap(std::tuple<folly::Try<Ts>...>&& /* o */,
Ts&&... ts) {
return std::tuple<Ts...>(std::forward<Ts>(ts)...);
}
};
-template <template <typename ...> class T, typename... Ts>
-void collectVariadicHelper(const std::shared_ptr<T<Ts...>>& ctx) {
+template <template <typename...> class T, typename... Ts>
+void collectVariadicHelper(const std::shared_ptr<T<Ts...>>& /* ctx */) {
// base case
}