Bug 223105

Summary: Introduce ensureOnMainThread()
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: Web Template FrameworkAssignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: aboxhall, apinheiro, benjamin, calvaris, cfleizach, changseok, cmarcelo, darin, dmazzoni, eric.carlson, esprehn+autocc, ews-watchlist, galpeter, glenn, gyuyoung.kim, hta, jcraig, jdiggs, jer.noble, kangil.han, mmaxfield, philipj, samuel_white, sergio, tommyw, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=223094
Attachments:
Description Flags
Patch none

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>