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

Unified Diff: third_party/WebKit/Source/platform/heap/ThreadState.cpp

Issue 2951903003: Hold global GC heap lock while making audio thread access. (Closed)
Patch Set: consistent lock scope wrt heap object in question Created 3 years, 6 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 | « third_party/WebKit/Source/platform/heap/PersistentNode.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/heap/ThreadState.cpp
diff --git a/third_party/WebKit/Source/platform/heap/ThreadState.cpp b/third_party/WebKit/Source/platform/heap/ThreadState.cpp
index 2c2b2630b7007c9910fcc1ae6a3226be81463c06..a8716456f3b924dcc1688d170aafe2a800546818 100644
--- a/third_party/WebKit/Source/platform/heap/ThreadState.cpp
+++ b/third_party/WebKit/Source/platform/heap/ThreadState.cpp
@@ -1453,9 +1453,11 @@ void ThreadState::CollectGarbage(BlinkGC::StackState stack_state,
GCForbiddenScope gc_forbidden_scope(this);
{
- // Access to the CrossThreadPersistentRegion has to be prevented while in
- // the marking phase because otherwise other threads may allocate or free
- // PersistentNodes and we can't handle that.
+ // Access to the CrossThreadPersistentRegion has to be prevented
+ // while in the marking phase because otherwise other threads may
+ // allocate or free PersistentNodes and we can't handle
+ // that. Grabbing this lock also prevents non-attached threads
+ // from accessing any GCed heap while a GC runs.
CrossThreadPersistentRegion::LockScope persistent_lock(
ProcessHeap::GetCrossThreadPersistentRegion());
{
« no previous file with comments | « third_party/WebKit/Source/platform/heap/PersistentNode.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698