Bug 242598 - Refine C++ coroutine use
Summary: Refine C++ coroutine use
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Alex Christensen
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-07-11 11:57 PDT by Alex Christensen
Modified: 2022-07-13 16:54 PDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Christensen 2022-07-11 11:57:04 PDT
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.
Comment 1 Alex Christensen 2022-07-11 12:01:56 PDT
Pull request: https://github.com/WebKit/WebKit/pull/2297
Comment 2 EWS 2022-07-13 16:53:43 PDT
Committed 252430@main (270e5776c43a): <https://commits.webkit.org/252430@main>

Reviewed commits have been landed. Closing PR #2297 and removing active labels.
Comment 3 Radar WebKit Bug Importer 2022-07-13 16:54:23 PDT
<rdar://problem/96981634>