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

Unified Diff: runtime/vm/thread_interrupter.cc

Issue 1261923008: Begin migration of InterruptableThreadState into Thread. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Parentheses. Created 5 years, 4 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
« no previous file with comments | « runtime/vm/thread_interrupter.h ('k') | runtime/vm/thread_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/thread_interrupter.cc
diff --git a/runtime/vm/thread_interrupter.cc b/runtime/vm/thread_interrupter.cc
index 10cff89a4663c002e888de443b3bb765ac4c9686..3ba1231e3929172627bdd9e4204930f04002010f 100644
--- a/runtime/vm/thread_interrupter.cc
+++ b/runtime/vm/thread_interrupter.cc
@@ -56,15 +56,10 @@ ThreadId ThreadInterrupter::interrupter_thread_id_ =
Monitor* ThreadInterrupter::monitor_ = NULL;
intptr_t ThreadInterrupter::interrupt_period_ = 1000;
intptr_t ThreadInterrupter::current_wait_time_ = Monitor::kNoTimeout;
-ThreadLocalKey ThreadInterrupter::thread_state_key_ =
- OSThread::kUnsetThreadLocalKey;
void ThreadInterrupter::InitOnce() {
ASSERT(!initialized_);
- ASSERT(thread_state_key_ == OSThread::kUnsetThreadLocalKey);
- thread_state_key_ = OSThread::CreateThreadLocal();
- ASSERT(thread_state_key_ != OSThread::kUnsetThreadLocalKey);
monitor_ = new Monitor();
ASSERT(monitor_ != NULL);
initialized_ = true;
@@ -231,15 +226,12 @@ InterruptableThreadState* ThreadInterrupter::GetCurrentThreadState() {
InterruptableThreadState* ThreadInterrupter::CurrentThreadState() {
- InterruptableThreadState* state = reinterpret_cast<InterruptableThreadState*>(
- OSThread::GetThreadLocal(thread_state_key_));
- return state;
+ return Thread::Current()->thread_state();
}
void ThreadInterrupter::SetCurrentThreadState(InterruptableThreadState* state) {
- OSThread::SetThreadLocal(thread_state_key_,
- reinterpret_cast<uword>(state));
+ Thread::Current()->set_thread_state(state);
}
« no previous file with comments | « runtime/vm/thread_interrupter.h ('k') | runtime/vm/thread_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698