Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
chloro-pn committed Jul 18, 2023
1 parent 6252e7a commit 42a39e4
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion async_simple/coro/Collect.h
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ inline auto collectAllWindowedImpl(size_t maxConcurrency,
output.push_back(std::move(t));
}
if (yield) {
co_await Yield();
co_await Yield{};
}
}
co_return std::move(output);
Expand Down
2 changes: 1 addition & 1 deletion async_simple/coro/Lazy.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class Lazy;
// execute, we could write:
//
// ```C++
// co_await Yield();
// co_await Yield{};
// ```
//
// This would suspend the executing coroutine.
Expand Down
2 changes: 1 addition & 1 deletion docs/docs.cn/Lazy.md
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ RescheduleLazy和Lazy持有的LazyLocals为一个void*类型的指针,类型
# Yield
有时我们可能希望主动让出一个 Lazy 协程的执行,将执行资源交给其他任务。(例如我们发现当前协程执行的时间太长了)
我们可以通过在 Lazy 中 `co_await async_simple::coro::Yield();` 来做到这一点。
我们可以通过在 Lazy 中 `co_await async_simple::coro::Yield{};` 来做到这一点。
# 获取当前调度器
Expand Down
2 changes: 1 addition & 1 deletion docs/docs.en/Lazy.md
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ If the user starts Lazy through 'start (callback)' and needs to recycle LazyLoca
# Yield
Sometimes we may want the executing Lazy to yield out. (For example, we found the Lazy has been executed for a long time)
We can yield it by `co_await async_simple::coro::Yield();` in the Lazy.
We can yield it by `co_await async_simple::coro::Yield{};` in the Lazy.
# Get the Current Executor
Expand Down

0 comments on commit 42a39e4

Please sign in to comment.