X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=folly%2Ffutures%2Fdetail%2FCore.h;h=a6ac6109a643da5549144b9986e838267a26e4c6;hb=a56a988a8cd07c7e3250f27594b8f92c9274b30d;hp=b2fb18d82baa399c07d76d753c5c439499f53da7;hpb=5022d5469d551c2a62d367792da9453392c464fa;p=folly.git diff --git a/folly/futures/detail/Core.h b/folly/futures/detail/Core.h index b2fb18d8..a6ac6109 100644 --- a/folly/futures/detail/Core.h +++ b/folly/futures/detail/Core.h @@ -27,7 +27,7 @@ #include #include #include -#include +#include #include #include @@ -334,28 +334,28 @@ class Core { if (LIKELY(x->getNumPriorities() == 1)) { x->add([this]() mutable { SCOPE_EXIT { detachOne(); }; - RequestContext::setContext(context_); + RequestContextScopeGuard rctx(context_); SCOPE_EXIT { callback_ = {}; }; callback_(std::move(*result_)); }); } else { x->addWithPriority([this]() mutable { SCOPE_EXIT { detachOne(); }; - RequestContext::setContext(context_); + RequestContextScopeGuard rctx(context_); SCOPE_EXIT { callback_ = {}; }; callback_(std::move(*result_)); }, priority); } } catch (...) { --attached_; // Account for extra ++attached_ before try - RequestContext::setContext(context_); + RequestContextScopeGuard rctx(context_); result_ = Try(exception_wrapper(std::current_exception())); SCOPE_EXIT { callback_ = {}; }; callback_(std::move(*result_)); } } else { SCOPE_EXIT { detachOne(); }; - RequestContext::setContext(context_); + RequestContextScopeGuard rctx(context_); SCOPE_EXIT { callback_ = {}; }; callback_(std::move(*result_)); }