Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 01e8c830aad13c9f1153f46306d1827739dda6a0
      
https://github.com/WebKit/WebKit/commit/01e8c830aad13c9f1153f46306d1827739dda6a0
  Author: Mark Lam <[email protected]>
  Date:   2025-11-14 (Fri, 14 Nov 2025)

  Changed paths:
    M Source/JavaScriptCore/runtime/VMManager.cpp
    M Source/JavaScriptCore/runtime/VMManager.h

  Log Message:
  -----------
  VMManager::singleton() is not thread safe.
https://bugs.webkit.org/show_bug.cgi?id=302540
rdar://164580639

Reviewed by Keith Miller.

VMManager::singleton() may be called concurrently from multiple threads.  Hence,
the initialization of the singleton instance needs to be done in a thread safe
manner.  To fix this, we'll switch from using a NeverDestroyed<VMManager> to a
LazyNeverDestroyed<VMManager>, and initialize it within a std::call_once, which
is thread safe.

Testing this requires a race condition that is hard to reproduce.
Will try to create a test for this in a separate path.

* Source/JavaScriptCore/runtime/VMManager.cpp:
(JSC::VMManager::singleton):
* Source/JavaScriptCore/runtime/VMManager.h:

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



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

Reply via email to