Skip to content

Commit 68a5d6d

Browse files
committed
add(post) 2 vim pages
Signed-off-by: scutKKsix <1129332011@qq.com>
1 parent f34bcdf commit 68a5d6d

4 files changed

Lines changed: 504 additions & 1 deletion

File tree

src/content/posts/OS/coroutine.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,17 @@ struct AsyncTask {
119119
}
120120
}
121121
};
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+
constexpr void await_suspend(coroutine_handle<>) const noexcept {}
131+
constexpr void await_resume() const noexcept {}
132+
};
122133
```
123134
124135
### **挂起的艺术:Awaitable 对象与 `co_await`**

0 commit comments

Comments
 (0)