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

Unified Diff: runtime/vm/thread_registry.h

Issue 1293253005: Completely remove InterruptableThreadState and Fix ThreadRegistry leak (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 4 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 side-by-side diff with in-line comments
Download patch
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.

Powered by Google App Engine
This is Rietveld 408576698