Commit 5e626b00 authored by ap@webkit.org's avatar ap@webkit.org

Reviewed by Oliver Hunt.

        Initialize threadMapMutex safely (as already done in ThreadingWin).

        * wtf/ThreadingGtk.cpp:
        (WTF::threadMapMutex):
        (WTF::initializeThreading):
        * wtf/ThreadingPthreads.cpp:
        (WTF::threadMapMutex):
        (WTF::initializeThreading):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@31939 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent f4a595bd
2008-04-16 Alexey Proskuryakov <ap@webkit.org>
Reviewed by Oliver Hunt.
Initialize threadMapMutex safely (as already done in ThreadingWin).
* wtf/ThreadingGtk.cpp:
(WTF::threadMapMutex):
(WTF::initializeThreading):
* wtf/ThreadingPthreads.cpp:
(WTF::threadMapMutex):
(WTF::initializeThreading):
2008-04-16 Alexey Proskuryakov <ap@webkit.org>
Reviewed by Adam Roben.
......
......@@ -41,24 +41,25 @@ Mutex* atomicallyInitializedStaticMutex;
static ThreadIdentifier mainThreadIdentifier;
static Mutex& threadMapMutex()
{
static Mutex mutex;
return mutex;
}
void initializeThreading()
{
if (!g_thread_supported()) {
g_thread_init(NULL);
ASSERT(!atomicallyInitializedStaticMutex);
atomicallyInitializedStaticMutex = new Mutex;
threadMapMutex();
wtf_random_init();
mainThreadIdentifier = currentThread();
}
ASSERT(g_thread_supported());
}
static Mutex& threadMapMutex()
{
static Mutex mutex;
return mutex;
}
static HashMap<ThreadIdentifier, GThread*>& threadMap()
{
static HashMap<ThreadIdentifier, GThread*> map;
......
......@@ -41,21 +41,22 @@ Mutex* atomicallyInitializedStaticMutex;
static ThreadIdentifier mainThreadIdentifier;
static Mutex& threadMapMutex()
{
static Mutex mutex;
return mutex;
}
void initializeThreading()
{
if (!atomicallyInitializedStaticMutex) {
atomicallyInitializedStaticMutex = new Mutex;
threadMapMutex();
wtf_random_init();
mainThreadIdentifier = currentThread();
}
}
static Mutex& threadMapMutex()
{
static Mutex mutex;
return mutex;
}
static HashMap<ThreadIdentifier, pthread_t>& threadMap()
{
static HashMap<ThreadIdentifier, pthread_t> map;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment