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

Unified Diff: runtime/vm/isolate.cc

Issue 9328042: Move the thread local functions to the Thread class in runtime/platform (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Reverted unintentional change Created 8 years, 10 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: runtime/vm/isolate.cc
diff --git a/runtime/vm/isolate.cc b/runtime/vm/isolate.cc
index e2c77fa0066167c8263fda45688a222fc1a48953..c4d7978da840dab96b4fe38a60670703368d081c 100644
--- a/runtime/vm/isolate.cc
+++ b/runtime/vm/isolate.cc
@@ -134,6 +134,21 @@ Isolate::~Isolate() {
message_handler_ = NULL; // Fail fast if we send messages to a dead isolate.
}
+void Isolate::SetCurrent(Isolate* current) {
+ Thread::SetThreadLocal(isolate_key, reinterpret_cast<uword>(current));
+}
+
+
+ThreadLocalKey Isolate::isolate_key = Thread::kInvalidThreadLocal;
+
+
+void Isolate::InitOnce() {
+ ASSERT(isolate_key == Thread::kInvalidThreadLocal);
+ isolate_key = Thread::CreateThreadLocal();
+ ASSERT(isolate_key != Thread::kInvalidThreadLocal);
+ create_callback_ = NULL;
+}
+
Isolate* Isolate::Init(const char* name_prefix) {
Isolate* result = new Isolate();

Powered by Google App Engine
This is Rietveld 408576698