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

Side by Side Diff: runtime/vm/thread.cc

Issue 1037453002: Split Thread/Isolate instances, but still maintain 1:1 relationship. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file.
4
5 #include "vm/thread.h"
6
7 #include "vm/isolate.h"
8 #include "vm/os_thread.h"
9
10
11 namespace dart {
12
13 // The single thread local key which stores all the thread local data
14 // for a thread.
15 // TODO(koda): Can we merge this with ThreadInterrupter::thread_state_key_?
16 ThreadLocalKey Thread::thread_key = OSThread::kUnsetThreadLocalKey;
17
18
19 void Thread::InitOnce() {
20 ASSERT(thread_key == OSThread::kUnsetThreadLocalKey);
21 thread_key = OSThread::CreateThreadLocal();
22 ASSERT(thread_key != OSThread::kUnsetThreadLocalKey);
23 }
24
25
26 void Thread::SetCurrent(Thread* current) {
27 OSThread::SetThreadLocal(thread_key, reinterpret_cast<uword>(current));
28 }
29
30 } // namespace dart
OLDNEW
« runtime/vm/thread.h ('K') | « runtime/vm/thread.h ('k') | runtime/vm/vm_sources.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698