Bug 213612

Summary: WTF::callOnMainThread should not require the main runloop to be initialized
Product: WebKit Reporter: Tadeu Zagallo <tzagallo>
Component: Web Template FrameworkAssignee: Tadeu Zagallo <tzagallo>
Status: RESOLVED FIXED    
Severity: Normal CC: benjamin, cdumez, cmarcelo, ews-watchlist, webkit-bug-importer, ysuzuki
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
ysuzuki: review+
Patch
none
Patch for landing none

Description Tadeu Zagallo 2020-06-25 11:31:43 PDT
...
Comment 1 Tadeu Zagallo 2020-06-25 11:34:31 PDT
<rdar://problem/64446028>
Comment 2 Tadeu Zagallo 2020-06-25 11:35:23 PDT
Created attachment 402751 [details]
Patch
Comment 3 Yusuke Suzuki 2020-06-25 11:37:52 PDT
Comment on attachment 402751 [details]
Patch

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

r=me

> Source/WTF/wtf/cocoa/MainThreadCocoa.mm:134
> +    if (RunLoop::mainIfExists()) {
> +        RunLoop::main().dispatch(dispatchFunctionsFromMainThread);
> +        return;
> +    }

Let's ensure that `s_mainRunLoop` is set after initializing RunLoop fully by inserting `WTF::storeStoreFence()` before `s_mainRunLoop = &RunLoop::current()`.
Comment 4 Tadeu Zagallo 2020-06-25 11:51:45 PDT
Created attachment 402765 [details]
Patch
Comment 5 Tadeu Zagallo 2020-06-25 12:01:59 PDT
Created attachment 402770 [details]
Patch for landing
Comment 6 EWS 2020-06-25 12:38:18 PDT
Committed r263524: <https://trac.webkit.org/changeset/263524>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 402770 [details].