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

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

Issue 1454553004: Create code and instruction object, and install them in the background compilation thread while br… (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Address comments Created 5 years, 1 month 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/stub_code.cc ('k') | no next file » | 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_REGISTRY_H_ 5 #ifndef VM_THREAD_REGISTRY_H_
6 #define VM_THREAD_REGISTRY_H_ 6 #define VM_THREAD_REGISTRY_H_
7 7
8 #include "vm/globals.h" 8 #include "vm/globals.h"
9 #include "vm/growable_array.h" 9 #include "vm/growable_array.h"
10 #include "vm/isolate.h" 10 #include "vm/isolate.h"
(...skipping 30 matching lines...) Expand all
41 // TODO(koda): Consider adding a scope helper to avoid omitting this call. 41 // TODO(koda): Consider adding a scope helper to avoid omitting this call.
42 void ResumeAllThreads(); 42 void ResumeAllThreads();
43 43
44 // Indicate that the current thread is at a safepoint, and offer to wait for 44 // Indicate that the current thread is at a safepoint, and offer to wait for
45 // any pending rendezvous request (if none, returns immediately). 45 // any pending rendezvous request (if none, returns immediately).
46 void CheckSafepoint() { 46 void CheckSafepoint() {
47 MonitorLocker ml(monitor_); 47 MonitorLocker ml(monitor_);
48 CheckSafepointLocked(); 48 CheckSafepointLocked();
49 } 49 }
50 50
51 bool AtSafepoint() const { return in_rendezvous_; }
52
51 bool RestoreStateTo(Thread* thread, Thread::State* state, 53 bool RestoreStateTo(Thread* thread, Thread::State* state,
52 bool bypass_safepoint) { 54 bool bypass_safepoint) {
53 MonitorLocker ml(monitor_); 55 MonitorLocker ml(monitor_);
54 // Wait for any rendezvous in progress. 56 // Wait for any rendezvous in progress.
55 while (!bypass_safepoint && in_rendezvous_) { 57 while (!bypass_safepoint && in_rendezvous_) {
56 ml.Wait(Monitor::kNoTimeout); 58 ml.Wait(Monitor::kNoTimeout);
57 } 59 }
58 Entry* entry = FindEntry(thread); 60 Entry* entry = FindEntry(thread);
59 if (entry != NULL) { 61 if (entry != NULL) {
60 Thread::State st = entry->state; 62 Thread::State st = entry->state;
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 intptr_t remaining_; // Number of threads yet to reach their safepoint. 205 intptr_t remaining_; // Number of threads yet to reach their safepoint.
204 int64_t round_; // Counter, to prevent missing updates to remaining_ 206 int64_t round_; // Counter, to prevent missing updates to remaining_
205 // (see comments in CheckSafepointLocked). 207 // (see comments in CheckSafepointLocked).
206 208
207 DISALLOW_COPY_AND_ASSIGN(ThreadRegistry); 209 DISALLOW_COPY_AND_ASSIGN(ThreadRegistry);
208 }; 210 };
209 211
210 } // namespace dart 212 } // namespace dart
211 213
212 #endif // VM_THREAD_REGISTRY_H_ 214 #endif // VM_THREAD_REGISTRY_H_
OLDNEW
« no previous file with comments | « runtime/vm/stub_code.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698