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

Unified Diff: runtime/vm/thread_registry.cc

Issue 1806093002: Clear reusable handles of helper threads as well. Visit mutator_thread_ even if it is not active (a… (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 9 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
« no previous file with comments | « runtime/vm/thread.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/thread_registry.cc
diff --git a/runtime/vm/thread_registry.cc b/runtime/vm/thread_registry.cc
index 111ae57596f7cd3ddceca27cd9eb9cf1e0cf242d..6b340733e789723ff76f3004d84ccf4e639d8935 100644
--- a/runtime/vm/thread_registry.cc
+++ b/runtime/vm/thread_registry.cc
@@ -65,12 +65,16 @@ void ThreadRegistry::ReturnThreadLocked(bool is_mutator, Thread* thread) {
void ThreadRegistry::VisitObjectPointers(ObjectPointerVisitor* visitor,
bool validate_frames) {
MonitorLocker ml(threads_lock());
+ bool mutator_thread_visited = false;
Thread* thread = active_list_;
while (thread != NULL) {
if (thread->zone() != NULL) {
thread->zone()->VisitObjectPointers(visitor);
}
thread->VisitObjectPointers(visitor);
+ if (mutator_thread_ == thread) {
+ mutator_thread_visited = true;
+ }
// Iterate over all the stack frames and visit objects on the stack.
StackFrameIterator frames_iterator(thread->top_exit_frame_info(),
validate_frames);
@@ -81,6 +85,11 @@ void ThreadRegistry::VisitObjectPointers(ObjectPointerVisitor* visitor,
}
thread = thread->next_;
}
+ // Visit mutator thread even if it is not in the active list because of
+ // api handles.
+ if (!mutator_thread_visited && (mutator_thread_ != NULL)) {
+ mutator_thread_->VisitObjectPointers(visitor);
+ }
}
« no previous file with comments | « runtime/vm/thread.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698