Bug 167832 - Fix misleading comment in RunLoop.h
Summary: Fix misleading comment in RunLoop.h
Status: REOPENED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Template Framework (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Joseph Pecoraro
URL:
Keywords:
Depends on: 168152
Blocks:
  Show dependency treegraph
 
Reported: 2017-02-03 21:36 PST by Joseph Pecoraro
Modified: 2019-05-02 16:22 PDT (History)
11 users (show)

See Also:


Attachments
[PATCH] Proposed Fix (1.43 KB, patch)
2017-02-03 21:37 PST, Joseph Pecoraro
no flags Details | Formatted Diff | Diff
[PATCH] Proposed Fix (1.81 KB, patch)
2017-02-04 15:55 PST, Joseph Pecoraro
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Joseph Pecoraro 2017-02-03 21:36:25 PST
Fix misleading comment in RunLoop.h.

Mac initialization used to force using CFRunLoopGetMain(). Now however it just uses RunLoop::current which uses CFRunLoopGetCurrent(). So this comment that it can be done on any thread is misleading and can lead to incorrect behavior if it is actually done on a non-main thread on Mac.
Comment 1 Joseph Pecoraro 2017-02-03 21:37:33 PST
Created attachment 300604 [details]
[PATCH] Proposed Fix
Comment 2 Alexey Proskuryakov 2017-02-04 00:07:57 PST
Comment on attachment 300604 [details]
[PATCH] Proposed Fix

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

> Source/WTF/wtf/RunLoop.h:53
> +    // Must be called from the main thread.

On the Mac, this can be checked with an assertion (using pthread_main_np).
Comment 3 Joseph Pecoraro 2017-02-04 15:55:50 PST
Created attachment 300643 [details]
[PATCH] Proposed Fix
Comment 4 Joseph Pecoraro 2017-02-04 17:04:49 PST
Comment on attachment 300643 [details]
[PATCH] Proposed Fix

Oh, that makes sense. WebKit1 will need some kind of "wait a beat".
Comment 5 Joseph Pecoraro 2017-02-04 17:05:38 PST
Comment on attachment 300643 [details]
[PATCH] Proposed Fix

That comment was meant for another bug.
Comment 6 WebKit Commit Bot 2017-02-10 13:10:06 PST
Comment on attachment 300643 [details]
[PATCH] Proposed Fix

Clearing flags on attachment: 300643

Committed r212139: <http://trac.webkit.org/changeset/212139>
Comment 7 WebKit Commit Bot 2017-02-10 13:10:12 PST
All reviewed patches have been landed.  Closing bug.
Comment 8 WebKit Commit Bot 2017-02-10 16:17:10 PST
Re-opened since this is blocked by bug 168152
Comment 9 Joseph Pecoraro 2017-02-10 16:23:02 PST
This revealed a few issues where non-main thread code triggers WebKit2Initialize and so could potentially be initializing the main run loop on a non-main thread (because WebKit2Initialize is not dispatch_once and always calls down into RunLoop::initializeMainThread).

For example, this case in DumpRenderTree: (Bug 168149)
https://bugs.webkit.org/show_bug.cgi?id=168149