]> git.saurik.com Git - apple/javascriptcore.git/blobdiff - wtf/ThreadingWin.cpp
JavaScriptCore-621.1.tar.gz
[apple/javascriptcore.git] / wtf / ThreadingWin.cpp
index 73c3f0c14d1cef386caf344f261eb5f8354abb00..c16be5aa86de3c8b1ad7de92bbfe19568bd7a8ee 100644 (file)
@@ -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<DWORD, HANDLE>& threadMap()
@@ -275,11 +271,6 @@ ThreadIdentifier currentThread()
     return static_cast<ThreadIdentifier>(GetCurrentThreadId());
 }
 
-bool isMainThread()
-{
-    return currentThread() == mainThreadIdentifier;
-}
-
 Mutex::Mutex()
 {
     m_mutex.m_recursionCount = 0;