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

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

Issue 1537543002: Fix for issue 25236 (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: code-review-comments Created 5 years 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
« no previous file with comments | « runtime/vm/os_thread_win.cc ('k') | runtime/vm/thread.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 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 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. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #ifndef VM_THREAD_H_ 5 #ifndef VM_THREAD_H_
6 #define VM_THREAD_H_ 6 #define VM_THREAD_H_
7 7
8 #include "include/dart_api.h" 8 #include "include/dart_api.h"
9 #include "vm/globals.h" 9 #include "vm/globals.h"
10 #include "vm/handles.h" 10 #include "vm/handles.h"
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 // The currently executing thread, or NULL if not yet initialized. 115 // The currently executing thread, or NULL if not yet initialized.
116 static Thread* Current() { 116 static Thread* Current() {
117 BaseThread* thread = OSThread::GetCurrentTLS(); 117 BaseThread* thread = OSThread::GetCurrentTLS();
118 if (thread == NULL || thread->is_os_thread()) { 118 if (thread == NULL || thread->is_os_thread()) {
119 return NULL; 119 return NULL;
120 } 120 }
121 return reinterpret_cast<Thread*>(thread); 121 return reinterpret_cast<Thread*>(thread);
122 } 122 }
123 123
124 // Makes the current thread enter 'isolate'. 124 // Makes the current thread enter 'isolate'.
125 static void EnterIsolate(Isolate* isolate); 125 static bool EnterIsolate(Isolate* isolate);
126 // Makes the current thread exit its isolate. 126 // Makes the current thread exit its isolate.
127 static void ExitIsolate(); 127 static void ExitIsolate();
128 128
129 // A VM thread other than the main mutator thread can enter an isolate as a 129 // A VM thread other than the main mutator thread can enter an isolate as a
130 // "helper" to gain limited concurrent access to the isolate. One example is 130 // "helper" to gain limited concurrent access to the isolate. One example is
131 // SweeperTask (which uses the class table, which is copy-on-write). 131 // SweeperTask (which uses the class table, which is copy-on-write).
132 // TODO(koda): Properly synchronize heap access to expand allowed operations. 132 // TODO(koda): Properly synchronize heap access to expand allowed operations.
133 static void EnterIsolateAsHelper(Isolate* isolate, 133 static bool EnterIsolateAsHelper(Isolate* isolate,
134 bool bypass_safepoint = false); 134 bool bypass_safepoint = false);
135 static void ExitIsolateAsHelper(bool bypass_safepoint = false); 135 static void ExitIsolateAsHelper(bool bypass_safepoint = false);
136 136
137 // Called when the current thread transitions from mutator to collector. 137 // Called when the current thread transitions from mutator to collector.
138 // Empties the store buffer block into the isolate. 138 // Empties the store buffer block into the isolate.
139 // TODO(koda): Always run GC in separate thread. 139 // TODO(koda): Always run GC in separate thread.
140 static void PrepareForGC(); 140 static void PrepareForGC();
141 141
142 // OSThread corresponding to this thread. 142 // OSThread corresponding to this thread.
143 OSThread* os_thread() const { return os_thread_; } 143 OSThread* os_thread() const { return os_thread_; }
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after
498 // Disable thread interrupts. 498 // Disable thread interrupts.
499 class DisableThreadInterruptsScope : public StackResource { 499 class DisableThreadInterruptsScope : public StackResource {
500 public: 500 public:
501 explicit DisableThreadInterruptsScope(Thread* thread); 501 explicit DisableThreadInterruptsScope(Thread* thread);
502 ~DisableThreadInterruptsScope(); 502 ~DisableThreadInterruptsScope();
503 }; 503 };
504 504
505 } // namespace dart 505 } // namespace dart
506 506
507 #endif // VM_THREAD_H_ 507 #endif // VM_THREAD_H_
OLDNEW
« no previous file with comments | « runtime/vm/os_thread_win.cc ('k') | runtime/vm/thread.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698