| OLD | NEW |
| 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 Loading... |
| 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_ |
| OLD | NEW |