Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(236)

Unified Diff: third_party/WebKit/Source/platform/heap/SafePoint.cpp

Issue 1477023003: Refactor the Heap into ThreadHeap to prepare for per thread heaps Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/platform/heap/SafePoint.cpp
diff --git a/third_party/WebKit/Source/platform/heap/SafePoint.cpp b/third_party/WebKit/Source/platform/heap/SafePoint.cpp
index 692cc7f00f3434eecfd46f4aa8ab9fcde19f3b12..7123964e973647344fd76292b8704705ecd5c7ee 100644
--- a/third_party/WebKit/Source/platform/heap/SafePoint.cpp
+++ b/third_party/WebKit/Source/platform/heap/SafePoint.cpp
@@ -4,6 +4,7 @@
#include "platform/heap/SafePoint.h"
+#include "platform/heap/Heap.h"
#include "wtf/Atomics.h"
#include "wtf/CurrentTime.h"
@@ -34,8 +35,8 @@ bool SafePointBarrier::parkOthers()
ThreadState* current = ThreadState::current();
// Lock threadAttachMutex() to prevent threads from attaching.
- ThreadState::lockThreadAttachMutex();
- ThreadState::AttachedThreadStateSet& threads = ThreadState::attachedThreads();
+ current->lockThreadAttachMutex();
+ const ThreadStateSet& threads = current->heap().threads();
MutexLocker locker(m_mutex);
atomicAdd(&m_unparkedThreadCount, threads.size());
@@ -64,7 +65,8 @@ bool SafePointBarrier::parkOthers()
void SafePointBarrier::resumeOthers(bool barrierLocked)
{
- ThreadState::AttachedThreadStateSet& threads = ThreadState::attachedThreads();
+ ThreadState* current = ThreadState::current();
+ const ThreadStateSet& threads = current->heap().threads();
atomicSubtract(&m_unparkedThreadCount, threads.size());
releaseStore(&m_canResume, 1);
@@ -77,7 +79,7 @@ void SafePointBarrier::resumeOthers(bool barrierLocked)
m_resume.broadcast();
}
- ThreadState::unlockThreadAttachMutex();
+ current->unlockThreadAttachMutex();
ASSERT(ThreadState::current()->isAtSafePoint());
}
« no previous file with comments | « third_party/WebKit/Source/platform/heap/RunAllTests.cpp ('k') | third_party/WebKit/Source/platform/heap/ThreadState.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698