Commit 14410cc6 authored by Melanie Subbiah's avatar Melanie Subbiah Committed by Facebook Github Bot 6

Create trace points for thread events

Summary: RequestContext update.

Reviewed By: mibpl

Differential Revision: D3604937

fbshipit-source-id: 07b315fe22a6dba40f0bab53c8092f35c172ae85
parent b837180a
...@@ -105,16 +105,16 @@ void RequestContext::clearContextData(const std::string& val) { ...@@ -105,16 +105,16 @@ void RequestContext::clearContextData(const std::string& val) {
std::shared_ptr<RequestContext> RequestContext::setContext( std::shared_ptr<RequestContext> RequestContext::setContext(
std::shared_ptr<RequestContext> ctx) { std::shared_ptr<RequestContext> ctx) {
auto& prev = getStaticContext(); auto& curCtx = getStaticContext();
if (ctx != prev) { if (ctx != curCtx) {
using std::swap; using std::swap;
if (prev) { if (curCtx) {
prev->onUnset(); curCtx->onUnset();
} }
if (ctx) { swap(ctx, curCtx);
ctx->onSet(); if (curCtx) {
curCtx->onSet();
} }
swap(ctx, prev);
} }
return ctx; return ctx;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment