X-Git-Url: https://git.saurik.com/apple/javascriptcore.git/blobdiff_plain/fb8617cde5834786bd4e4afd579883e4acf5666e..4e4e5a6f2694187498445a6ac6f1634ce8141119:/wtf/ThreadingWin.cpp diff --git a/wtf/ThreadingWin.cpp b/wtf/ThreadingWin.cpp index 73c3f0c..c16be5a 100644 --- a/wtf/ThreadingWin.cpp +++ b/wtf/ThreadingWin.cpp @@ -145,8 +145,6 @@ void unlockAtomicallyInitializedStaticMutex() atomicallyInitializedStaticMutex->unlock(); } -static ThreadIdentifier mainThreadIdentifier; - static Mutex& threadMapMutex() { static Mutex mutex; @@ -155,14 +153,12 @@ static Mutex& threadMapMutex() void initializeThreading() { - if (!atomicallyInitializedStaticMutex) { - atomicallyInitializedStaticMutex = new Mutex; - threadMapMutex(); - initializeRandomNumberGenerator(); - initializeMainThread(); - mainThreadIdentifier = currentThread(); - initializeCurrentThreadInternal("Main Thread"); - } + if (atomicallyInitializedStaticMutex) + return; + + atomicallyInitializedStaticMutex = new Mutex; + threadMapMutex(); + initializeRandomNumberGenerator(); } static HashMap& threadMap() @@ -275,11 +271,6 @@ ThreadIdentifier currentThread() return static_cast(GetCurrentThreadId()); } -bool isMainThread() -{ - return currentThread() == mainThreadIdentifier; -} - Mutex::Mutex() { m_mutex.m_recursionCount = 0;