Index: runtime/vm/thread_registry.h |
diff --git a/runtime/vm/thread_registry.h b/runtime/vm/thread_registry.h |
index 286227a2efe34e2be2faab6dccbb9c4b83a8d3a4..dd5da57411ca6aa1bb8d92bb1a4586df7f67e8ed 100644 |
--- a/runtime/vm/thread_registry.h |
+++ b/runtime/vm/thread_registry.h |
@@ -138,7 +138,8 @@ class ThreadRegistry { |
} |
} |
- private: |
+ void PruneThread(Thread* thread); |
+ |
struct Entry { |
// NOTE: |thread| is deleted automatically when the thread exits. |
// In other words, it is not safe to dereference |thread| unless you are on |
@@ -148,6 +149,25 @@ class ThreadRegistry { |
Thread::State state; |
}; |
+ class EntryIterator { |
+ public: |
+ explicit EntryIterator(ThreadRegistry* registry); |
+ ~EntryIterator(); |
+ |
+ void Reset(ThreadRegistry* registry); |
+ |
+ // Returns false when there are no more entries. |
+ bool HasNext() const; |
+ |
+ // Returns the next entry and moves forward. |
+ const Entry& Next(); |
+ |
+ private: |
+ intptr_t index_; |
+ ThreadRegistry* registry_; |
+ }; |
+ |
+ private: |
// Returns Entry corresponding to thread in registry or NULL. |
// Note: Lock should be taken before this function is called. |
// TODO(koda): Add method Monitor::IsOwnedByCurrentThread. |