Bug 242598
Summary: | Refine C++ coroutine use | ||
---|---|---|---|
Product: | WebKit | Reporter: | Alex Christensen <achristensen> |
Component: | WebKit Misc. | Assignee: | Alex Christensen <achristensen> |
Status: | RESOLVED FIXED | ||
Severity: | Normal | CC: | webkit-bug-importer |
Priority: | P2 | Keywords: | InRadar |
Version: | WebKit Nightly Build | ||
Hardware: | Unspecified | ||
OS: | Unspecified |
Alex Christensen
Task::promise_type::final_suspend() needs to return a std::experimental::suspend_always instead of a std::experimental::suspend_never, otherwise it crashes if we ever use co_return. We don't yet, but we probably will.
ReceiveOperation and SendOperation inherit from std::experimental::suspend_never but override await_ready with an implementation more like std::experimental::suspend_always, and an await_suspend that actually does something interesting. Instead of inheriting from std::experimental::suspend_never, just write out everything it does, which just requires adding an await_resume that returns void.
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Alex Christensen
Pull request: https://github.com/WebKit/WebKit/pull/2297
EWS
Committed 252430@main (270e5776c43a): <https://commits.webkit.org/252430@main>
Reviewed commits have been landed. Closing PR #2297 and removing active labels.
Radar WebKit Bug Importer
<rdar://problem/96981634>