Commit a87085f2 authored by Shai Szulanski's avatar Shai Szulanski Committed by Facebook GitHub Bot

Prohibit passing empty KeepAlive to scheduleOn

Summary: Doing so is a bug that can take some time to pin down. Fail at the callsite instead to make this easier.

Reviewed By: yfeldblum

Differential Revision: D27829947

fbshipit-source-id: e3628331ffb687718309e130e8e0f2f78c4eb1aa
parent b5e88664
......@@ -190,6 +190,7 @@ class AsyncGeneratorPromise {
}
void setExecutor(folly::Executor::KeepAlive<> executor) noexcept {
DCHECK(executor);
executor_ = std::move(executor);
}
......
......@@ -564,6 +564,7 @@ class FOLLY_NODISCARD Task {
void setExecutor(folly::Executor::KeepAlive<>&& e) noexcept {
DCHECK(coro_);
DCHECK(e);
coro_.promise().executor_ = std::move(e);
}
......
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