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.
Created attachment 423001 [details] Patch
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!
Committed r274324: <https://commits.webkit.org/r274324> All reviewed patches have been landed. Closing bug and clearing flags on attachment 423001 [details].
<rdar://problem/75346904>