Skip to content

Commit 400cda5

Browse files
generatedunixname1395027625275998meta-codesync[bot]
authored andcommitted
Avoid redundant shared_ptr copy by moving RequestContext into scope guard in runTask
Reviewed By: kunalspathak Differential Revision: D110114377 fbshipit-source-id: 77e0c917851b9c5ac45bef4bf508e9ea892ecdb2
1 parent fdf10f7 commit 400cda5

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎folly/executors/ThreadPoolExecutor.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ void ThreadPoolExecutor::runTask(const ThreadPtr& thread, Task&& task) {
138138
taskInfo.taskId);
139139

140140
{
141-
folly::RequestContextScopeGuard rctx(task.context_);
141+
folly::RequestContextScopeGuard rctx(std::move(task.context_));
142142
// taskDequeued() and taskProcessed() run inside this scope so observers see
143143
// the task's RequestContext -- the same context task.func_ runs under --
144144
// letting them associate executor accounting (e.g. queue wait) with the

0 commit comments

Comments
 (0)