Bug 213612 - WTF::callOnMainThread should not require the main runloop to be initialized
Summary: WTF::callOnMainThread should not require the main runloop to be initialized
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: Tadeu Zagallo
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-06-25 11:31 PDT by Tadeu Zagallo
Modified: 2020-06-25 12:38 PDT (History)
6 users (show)

See Also:


Attachments
Patch (3.85 KB, patch)
2020-06-25 11:35 PDT, Tadeu Zagallo
ysuzuki: review+
Details | Formatted Diff | Diff
Patch (4.17 KB, patch)
2020-06-25 11:51 PDT, Tadeu Zagallo
no flags Details | Formatted Diff | Diff
Patch for landing (4.28 KB, patch)
2020-06-25 12:01 PDT, Tadeu Zagallo
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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].