DescriptionLock CrossThreadPersistentRegion until end of weak processing.
Allocating & releasing a CrossThread(Weak)Persistent is something that
all threads are currently allowed, even those not attached to Oilpan and
having no heap of their own. It is however not safe for the set of
CrossThreadPersistents to be altered while a garbage collection is
underway.
Not just while the set of registered persistents are being marked and
traced, but up until and including the processing of weak (persistent)
references that happen after marking. If not, a thread would be able to
release a CrossThreadWeakPersistent node which the weak processing separately
maintains a pointer to, clearing & freeing its allocation. Which would
cause havoc, hence we impose a lock on CrossThreadPersistentRegion while
the marking and global weak processing is being performed -- any thread
attempting to create or free cross-thread persistents will be locked out
for the duration.
Following r396432, the use of CrossThreadPersistents from non-attached threads
has been reduced greatly and is slight.
R=
BUG=610477
Committed: https://crrev.com/174054b089b91ea41c4baa09bcc7b6762fe42005
Cr-Commit-Position: refs/heads/master@{#396540}
Patch Set 1 #Patch Set 2 : compile fix #
Messages
Total messages: 12 (6 generated)
|