Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: f89bce6a688cb26449363da6713357ea63d1cc3e
      
https://github.com/WebKit/WebKit/commit/f89bce6a688cb26449363da6713357ea63d1cc3e
  Author: David Kilzer <[email protected]>
  Date:   2025-11-16 (Sun, 16 Nov 2025)

  Changed paths:
    M Source/WebCore/platform/WebCoreMainThread.cpp

  Log Message:
  -----------
  Fix main thread initialization when disabling WebThread
<https://bugs.webkit.org/show_bug.cgi?id=302600>
<rdar://164844902>

Reviewed by Chris Dumez.

* Source/WebCore/platform/WebCoreMainThread.cpp:
(WebCore::_initializeMainThreadWebCore): Add.
- Extract static method from initializeMainThreadIfNeeded().
(WebCore::initializeMainThreadIfNeeded):
- When WebThread enabled, this method returned early because
  StartWebThread() would perform "main" thread initialization when
  WebThread was started.  With WebThread disabled, this initialization
  may now incorrectly occur on a background thread if
  +[WebView initialize] is called there.  Avoid this issue by only
  initializing the main thread if pthread_main_np() is true, else
  schedule main thread initialization on the main thread asynchronously
  using CFRunLoopPerformBlock().

Canonical link: https://commits.webkit.org/303102@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to