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

Unified Diff: runtime/vm/isolate_linux.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: Addressed review comments from asiva@ 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
« no previous file with comments | « runtime/vm/isolate_linux.h ('k') | runtime/vm/isolate_macos.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/isolate_linux.cc
diff --git a/runtime/vm/isolate_linux.cc b/runtime/vm/isolate_linux.cc
deleted file mode 100644
index e530f18a67fffa518fdf51e9331216d2f8ae7476..0000000000000000000000000000000000000000
--- a/runtime/vm/isolate_linux.cc
+++ /dev/null
@@ -1,42 +0,0 @@
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-#include "vm/isolate.h"
-
-#include <errno.h>
-#include <pthread.h>
-
-#include "platform/assert.h"
-
-namespace dart {
-
-#define VALIDATE_PTHREAD_RESULT(result) \
- if (result != 0) { \
- FATAL2("pthread error: %d (%s)", result, strerror(result)); \
- }
-
-
-// The single pthread key which stores all the thread local data for a
-// thread. Since an Isolate is the central repository for storing all
-// isolate specific information a single pthread key is sufficient.
-pthread_key_t isolate_key = PTHREAD_KEY_UNSET;
-
-
-void Isolate::SetCurrent(Isolate* current) {
- ASSERT(isolate_key != PTHREAD_KEY_UNSET);
- int result = pthread_setspecific(isolate_key, current);
- VALIDATE_PTHREAD_RESULT(result);
-}
-
-
-void Isolate::InitOnce() {
- ASSERT(isolate_key == PTHREAD_KEY_UNSET);
- int result = pthread_key_create(&isolate_key, NULL);
- // Make sure creating a key was successful.
- VALIDATE_PTHREAD_RESULT(result);
- ASSERT(isolate_key != PTHREAD_KEY_UNSET);
- create_callback_ = NULL;
-}
-
-} // namespace dart
« no previous file with comments | « runtime/vm/isolate_linux.h ('k') | runtime/vm/isolate_macos.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698