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

Unified Diff: runtime/vm/thread_registry.cc

Issue 2640573003: Resolution for issue #5092: Unit test handle checks consider dangling handles to be valid. (Closed)
Patch Set: Resolution for issue #5092: Unit test handle checks consider dangling handles to be valid. Created 3 years, 11 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.cc
diff --git a/runtime/vm/thread_registry.cc b/runtime/vm/thread_registry.cc
index c2c81a4253b9388d2ef1082fe9f2fbaa03f67ce2..828d53f7b945f4fc056ad8f088f579d61537cc2e 100644
--- a/runtime/vm/thread_registry.cc
+++ b/runtime/vm/thread_registry.cc
@@ -105,6 +105,19 @@ void ThreadRegistry::PrintJSON(JSONStream* stream) const {
#endif
+bool ThreadRegistry::IsValidHandle(Dart_Handle handle) const {
+ MonitorLocker ml(threads_lock());
+ Thread* current = active_list_;
+ while (current != NULL) {
+ if (current->IsValidHandle(handle)) {
+ return true;
+ }
+ current = current->next_;
+ }
+ return false;
+}
+
+
intptr_t ThreadRegistry::CountZoneHandles() const {
MonitorLocker ml(threads_lock());
intptr_t count = 0;

Powered by Google App Engine
This is Rietveld 408576698