Changeset 256474 in webkit


Ignore:
Timestamp:
Feb 12, 2020 1:50:49 PM (4 years ago)
Author:
BJ Burg
Message:

Web Inspector: inspector/cpu-profiler/threads.html is flaky crashing
https://bugs.webkit.org/show_bug.cgi?id=207588
<rdar://problem/57458123>

Reviewed by Yusuke Suzuki.

  • page/cocoa/ResourceUsageThreadCocoa.mm:

(WebCore::ResourceUsageThread::platformCollectCPUData):
Use a fence to force Thread to be completely ready for use by other threads
prior to storing it. Otherwise, ResourceUsageThread may see it too early.

  • workers/WorkerThread.cpp:

(WebCore::WorkerThread::start): Ignore worker threads that are
not fully initialized.

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r256470 r256474  
     12020-02-12  Brian Burg  <bburg@apple.com>
     2
     3        Web Inspector: inspector/cpu-profiler/threads.html is flaky crashing
     4        https://bugs.webkit.org/show_bug.cgi?id=207588
     5        <rdar://problem/57458123>
     6
     7        Reviewed by Yusuke Suzuki.
     8
     9        * page/cocoa/ResourceUsageThreadCocoa.mm:
     10        (WebCore::ResourceUsageThread::platformCollectCPUData):
     11        Use a fence to force Thread to be completely ready for use by other threads
     12        prior to storing it. Otherwise, ResourceUsageThread may see it too early.
     13
     14        * workers/WorkerThread.cpp:
     15        (WebCore::WorkerThread::start): Ignore worker threads that are
     16        not fully initialized.
     17
    1182020-02-12  Youenn Fablet  <youenn@apple.com>
    219
  • trunk/Source/WebCore/page/cocoa/ResourceUsageThreadCocoa.mm

    r249417 r256474  
    169169        LockHolder lock(WorkerThread::workerThreadsMutex());
    170170        for (auto* thread : WorkerThread::workerThreads(lock)) {
     171            // Ignore worker threads that have not been fully started yet.
     172            if (!thread->thread())
     173                continue;
    171174            mach_port_t machThread = thread->thread()->machThread();
    172175            if (machThread != MACH_PORT_NULL)
  • trunk/Source/WebCore/workers/WorkerThread.cpp

    r256012 r256474  
    143143    m_evaluateCallback = WTFMove(evaluateCallback);
    144144
    145     m_thread = Thread::create(isServiceWorkerThread() ? "WebCore: Service Worker" : "WebCore: Worker", [this] {
     145    Ref<Thread> thread = Thread::create(isServiceWorkerThread() ? "WebCore: Service Worker" : "WebCore: Worker", [this] {
    146146        workerThread();
    147147    });
     148    // Force the Thread object to be initialized fully before storing it to m_thread (and becoming visible to other threads).
     149    WTF::storeStoreFence();
     150    m_thread = WTFMove(thread);
    148151}
    149152
Note: See TracChangeset for help on using the changeset viewer.