Index: Source/platform/heap/ThreadState.cpp |
diff --git a/Source/platform/heap/ThreadState.cpp b/Source/platform/heap/ThreadState.cpp |
index 87d0c40e847b614df6ebce10370292c8826cf9dc..3761aea84af0a8873aeb7c48d5c2525ed57d9275 100644 |
--- a/Source/platform/heap/ThreadState.cpp |
+++ b/Source/platform/heap/ThreadState.cpp |
@@ -96,7 +96,7 @@ uint8_t ThreadState::s_mainThreadStateStorage[sizeof(ThreadState)]; |
SafePointBarrier* ThreadState::s_safePointBarrier = 0; |
bool ThreadState::s_inGC = false; |
-static Mutex& threadAttachMutex() |
+Mutex& ThreadState::threadAttachMutex() |
{ |
AtomicallyInitializedStatic(Mutex&, mutex = *new Mutex); |
return mutex; |
@@ -123,7 +123,7 @@ public: |
ASSERT(ThreadState::current()->isAtSafePoint()); |
// Lock threadAttachMutex() to prevent threads from attaching. |
- threadAttachMutex().lock(); |
+ ThreadState::threadAttachMutex().lock(); |
ThreadState::AttachedThreadStateSet& threads = ThreadState::attachedThreads(); |
@@ -182,7 +182,7 @@ public: |
interruptors[i]->clearInterrupt(); |
} |
- threadAttachMutex().unlock(); |
+ ThreadState::threadAttachMutex().unlock(); |
ASSERT(ThreadState::current()->isAtSafePoint()); |
} |
@@ -315,7 +315,7 @@ void ThreadState::shutdown() |
void ThreadState::attachMainThread() |
{ |
RELEASE_ASSERT(!Heap::s_shutdownCalled); |
- MutexLocker locker(threadAttachMutex()); |
+ MutexLocker locker(ThreadState::threadAttachMutex()); |
ThreadState* state = new(s_mainThreadStateStorage) ThreadState(); |
attachedThreads().add(state); |
} |
@@ -331,7 +331,7 @@ void ThreadState::detachMainThread() |
state->enterSafePointWithoutPointers(); |
{ |
- MutexLocker locker(threadAttachMutex()); |
+ MutexLocker locker(ThreadState::threadAttachMutex()); |
state->leaveSafePoint(); |
ASSERT(attachedThreads().contains(state)); |
attachedThreads().remove(state); |
@@ -345,7 +345,7 @@ void ThreadState::shutdownHeapIfNecessary() |
// We don't need to enter a safe point before acquiring threadAttachMutex |
// because this thread is already detached. |
- MutexLocker locker(threadAttachMutex()); |
+ MutexLocker locker(ThreadState::threadAttachMutex()); |
// We start shutting down the heap if there is no running thread |
// and Heap::shutdown() is already called. |
if (!attachedThreads().size() && Heap::s_shutdownCalled) |
@@ -355,7 +355,7 @@ void ThreadState::shutdownHeapIfNecessary() |
void ThreadState::attach() |
{ |
RELEASE_ASSERT(!Heap::s_shutdownCalled); |
- MutexLocker locker(threadAttachMutex()); |
+ MutexLocker locker(ThreadState::threadAttachMutex()); |
ThreadState* state = new ThreadState(); |
attachedThreads().add(state); |
} |
@@ -397,7 +397,7 @@ void ThreadState::detach() |
state->enterSafePointWithoutPointers(); |
{ |
- MutexLocker locker(threadAttachMutex()); |
+ MutexLocker locker(ThreadState::threadAttachMutex()); |
state->leaveSafePoint(); |
ASSERT(attachedThreads().contains(state)); |
attachedThreads().remove(state); |
@@ -860,7 +860,7 @@ void ThreadState::addInterruptor(Interruptor* interruptor) |
SafePointScope scope(HeapPointersOnStack, SafePointScope::AllowNesting); |
{ |
- MutexLocker locker(threadAttachMutex()); |
+ MutexLocker locker(ThreadState::threadAttachMutex()); |
m_interruptors.append(interruptor); |
} |
} |
@@ -870,7 +870,7 @@ void ThreadState::removeInterruptor(Interruptor* interruptor) |
SafePointScope scope(HeapPointersOnStack, SafePointScope::AllowNesting); |
{ |
- MutexLocker locker(threadAttachMutex()); |
+ MutexLocker locker(ThreadState::threadAttachMutex()); |
size_t index = m_interruptors.find(interruptor); |
RELEASE_ASSERT(index >= 0); |
m_interruptors.remove(index); |