1 parent f34bcdf commit 68a5d6dCopy full SHA for 68a5d6d
4 files changed
src/content/posts/OS/coroutine.md
@@ -119,6 +119,17 @@ struct AsyncTask {
119
}
120
121
};
122
+
123
+struct suspend_always {
124
+ constexpr bool await_ready() const noexcept { return false; }
125
+ constexpr void await_suspend(coroutine_handle<>) const noexcept {}
126
+ constexpr void await_resume() const noexcept {}
127
+};
128
+struct suspend_never {
129
+ constexpr bool await_ready() const noexcept { return true; }
130
131
132
133
```
134
135
### **挂起的艺术:Awaitable 对象与 `co_await`**
0 commit comments