Ignore:
Timestamp:
Mar 28, 2017, 1:08:49 PM (8 years ago)
Author:
Yusuke Suzuki
Message:

[JSC] Move platformThreadSignal to WTF
https://bugs.webkit.org/show_bug.cgi?id=170097

Reviewed by Mark Lam.

Source/JavaScriptCore:

It is a small clean up towards https://bugs.webkit.org/show_bug.cgi?id=170027.
platformThreadSignal uses PlatformThread in JSC, but it can be implemented in
WTF ThreadIdentifier.

  • runtime/JSLock.cpp:

(JSC::JSLock::lock):

  • runtime/JSLock.h:

(JSC::JSLock::ownerThread):
(JSC::JSLock::currentThreadIsHoldingLock):

  • runtime/PlatformThread.h:

(JSC::platformThreadSignal): Deleted.

  • runtime/VM.h:

(JSC::VM::ownerThread):

  • runtime/VMTraps.cpp:

(JSC::VMTraps::SignalSender::send):

Source/WTF:

  • wtf/Threading.h:
  • wtf/ThreadingPthreads.cpp:

(WTF::signalThread):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/runtime/JSLock.h

    r213238 r214489  
    2121#pragma once
    2222
    23 #include "PlatformThread.h"
    2423#include <mutex>
    2524#include <wtf/Assertions.h>
     
    9493    VM* vm() { return m_vm; }
    9594
    96     std::optional<PlatformThread> ownerThread() const
     95    std::optional<ThreadIdentifier> ownerThread() const
    9796    {
    9897        if (m_hasOwnerThread)
    9998            return m_ownerThread;
    100         return { };
     99        return std::nullopt;
    101100    }
    102     bool currentThreadIsHoldingLock() { return m_hasOwnerThread && m_ownerThread == currentPlatformThread(); }
     101    bool currentThreadIsHoldingLock() { return m_hasOwnerThread && m_ownerThread == currentThread(); }
    103102
    104103    void willDestroyVM(VM*);
     
    137136    // See https://bugs.webkit.org/show_bug.cgi?id=169042#c6
    138137    bool m_hasOwnerThread { false };
    139     PlatformThread m_ownerThread;
     138    ThreadIdentifier m_ownerThread;
    140139    intptr_t m_lockCount;
    141140    unsigned m_lockDropDepth;
Note: See TracChangeset for help on using the changeset viewer.