Commit 6edefe20 authored by Andrii Grynenko's avatar Andrii Grynenko Committed by Facebook GitHub Bot

detachOnCancel: fix shadow-uncaptured-local warning

Summary: (Note: this ignores all push blocking failures!)

Differential Revision: D22684908

fbshipit-source-id: bb00bf2896880ae6ed5f189110bb13b5abbd80cd
parent 88ff31c0
......@@ -41,9 +41,9 @@ Task<semi_await_result_t<Awaitable>> detachOnCancel(Awaitable awaitable) {
.scheduleOn(co_await co_current_executor)
.startInlineUnsafe(
[postedPtr = posted.get(), &baton, &result](auto&& r) {
std::unique_ptr<std::atomic<bool>> posted(postedPtr);
if (!posted->exchange(true, std::memory_order_relaxed)) {
posted.release();
std::unique_ptr<std::atomic<bool>> p(postedPtr);
if (!p->exchange(true, std::memory_order_relaxed)) {
p.release();
tryAssign(result, std::move(r));
baton.post();
}
......
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