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) {
std::shared_ptr<RequestContext> RequestContext::setContext(
std::shared_ptr<RequestContext> ctx) {
auto& prev = getStaticContext();
if (ctx != prev) {
auto& curCtx = getStaticContext();
if (ctx != curCtx) {
using std::swap;
if (prev) {
prev->onUnset();
if (curCtx) {
curCtx->onUnset();
}
if (ctx) {
ctx->onSet();
swap(ctx, curCtx);
if (curCtx) {
curCtx->onSet();
}
swap(ctx, prev);
}
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