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

Unified Diff: runtime/vm/thread.cc

Issue 2363823002: Fix for issue 27380 - VM stuck in deadlock with background finalization and background compiler thr… (Closed)
Patch Set: Created 4 years, 3 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/pages.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/thread.cc
diff --git a/runtime/vm/thread.cc b/runtime/vm/thread.cc
index 967bac0d0e517b5f6e749636cbed04a71010f2dd..42df5357d8254b55e7cc496071f723072af84082 100644
--- a/runtime/vm/thread.cc
+++ b/runtime/vm/thread.cc
@@ -553,10 +553,13 @@ bool Thread::IsMutatorThread() const {
bool Thread::CanCollectGarbage() const {
- // We have non mutator threads grow the heap instead of triggering
- // a garbage collection when they are at a safepoint (e.g: background
- // compiler thread finalizing and installing code at a safepoint).
- return (IsMutatorThread() || IsAtSafepoint());
+ // We grow the heap instead of triggering a garbage collection when a
+ // thread is at a safepoint in the following situations :
+ // - background compiler thread finalizing and installing code
+ // - disassembly of the generated code is done after compilation
+ // So essentially we state that garbage collection is possible only
+ // when we are not at a safepoint.
+ return !IsAtSafepoint();
}
« no previous file with comments | « runtime/vm/pages.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698