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

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

Issue 1402383003: Simplify timeline backend (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 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
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 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 // TODO(koda): Add method Monitor::IsOwnedByCurrentThread. 181 // TODO(koda): Add method Monitor::IsOwnedByCurrentThread.
182 Entry* FindEntry(Thread* thread) { 182 Entry* FindEntry(Thread* thread) {
183 for (int i = 0; i < entries_.length(); ++i) { 183 for (int i = 0; i < entries_.length(); ++i) {
184 if (entries_[i].thread == thread) { 184 if (entries_[i].thread == thread) {
185 return &entries_[i]; 185 return &entries_[i];
186 } 186 }
187 } 187 }
188 return NULL; 188 return NULL;
189 } 189 }
190 190
191 // NOTE: Lock should be taken before this function is called.
192 void ReclaimTimelineBlockLocked(Entry* entry);
193
194 // Note: Lock should be taken before this function is called. 191 // Note: Lock should be taken before this function is called.
195 void CheckSafepointLocked(); 192 void CheckSafepointLocked();
196 193
197 // Returns the number threads that are scheduled on this isolate. 194 // Returns the number threads that are scheduled on this isolate.
198 // Note: Lock should be taken before this function is called. 195 // Note: Lock should be taken before this function is called.
199 intptr_t CountScheduledLocked(); 196 intptr_t CountScheduledLocked();
200 197
201 Monitor* monitor_; // All access is synchronized through this monitor. 198 Monitor* monitor_; // All access is synchronized through this monitor.
202 MallocGrowableArray<Entry> entries_; 199 MallocGrowableArray<Entry> entries_;
203 200
204 // Safepoint rendezvous state. 201 // Safepoint rendezvous state.
205 bool in_rendezvous_; // A safepoint rendezvous request is in progress. 202 bool in_rendezvous_; // A safepoint rendezvous request is in progress.
206 intptr_t remaining_; // Number of threads yet to reach their safepoint. 203 intptr_t remaining_; // Number of threads yet to reach their safepoint.
207 int64_t round_; // Counter, to prevent missing updates to remaining_ 204 int64_t round_; // Counter, to prevent missing updates to remaining_
208 // (see comments in CheckSafepointLocked). 205 // (see comments in CheckSafepointLocked).
209 206
210 DISALLOW_COPY_AND_ASSIGN(ThreadRegistry); 207 DISALLOW_COPY_AND_ASSIGN(ThreadRegistry);
211 }; 208 };
212 209
213 } // namespace dart 210 } // namespace dart
214 211
215 #endif // VM_THREAD_REGISTRY_H_ 212 #endif // VM_THREAD_REGISTRY_H_
OLDNEW
« no previous file with comments | « runtime/vm/thread.h ('k') | runtime/vm/thread_registry.cc » ('j') | runtime/vm/timeline.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698