Bug 223105 - Introduce ensureOnMainThread()
Summary: Introduce ensureOnMainThread()
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Template Framework (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-03-11 17:32 PST by Chris Dumez
Modified: 2021-03-11 20:49 PST (History)
26 users (show)

See Also:


Attachments
Patch (30.76 KB, patch)
2021-03-11 17:34 PST, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2021-03-11 17:32:42 PST
Introduce ensureOnMainThread(), similarly to the recently added ensureOnMainThreadRunLoop(). It runs the task synchronously when on the main thread, otherwise dispatches the task to the main thread.
Comment 1 Chris Dumez 2021-03-11 17:34:27 PST
Created attachment 423001 [details]
Patch
Comment 2 Darin Adler 2021-03-11 19:26:14 PST
Comment on attachment 423001 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=423001&action=review

> Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:-171
> -static void ensureOnMainThread(Function<void()>&& f)

Wow, would you look at that? Someone had the good name idea already!
Comment 3 EWS 2021-03-11 20:48:29 PST
Committed r274324: <https://commits.webkit.org/r274324>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 423001 [details].
Comment 4 Radar WebKit Bug Importer 2021-03-11 20:49:14 PST
<rdar://problem/75346904>