Skip to content

Commit

Permalink
Remove call to std::move from Work_EnsureDetachedTaskProgress that
Browse files Browse the repository at this point in the history
prevented copy elision, as flagged by clang.

(Internal change: 2266920)
  • Loading branch information
adamrwoodbury authored and pixar-oss committed Mar 14, 2023
1 parent 257a112 commit 84bd5a9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pxr/base/work/detachedTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Work_EnsureDetachedTaskProgress()
if (detachedWaiter.compare_exchange_strong(c, newThread)) {
// We won the race, so start the waiter thread.
WorkDispatcher &dispatcher = Work_GetDetachedDispatcher();
*newThread = std::move(
*newThread =
std::thread([&dispatcher]() {
while (true) {
// Process detached tasks.
Expand All @@ -64,7 +64,7 @@ Work_EnsureDetachedTaskProgress()
using namespace std::chrono_literals;
std::this_thread::sleep_for(50ms);
}
}));
});
newThread->detach();
}
else {
Expand Down

0 comments on commit 84bd5a9

Please sign in to comment.