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