DescriptionFix race when calling GetWeakPtr() from multiple threads.
WeakReferenceOwner allows moving ownership to a different thread
by checking if all WeakPtr instances have gone away and recreating
that flag if that is the case.
However the entirety of this operation is not atomic, and therefore
a race exists if the last WeakPtr instance goes away one one thread
while GetWeakPtr() is called on another thread.
Avoid this by keeping a persistent reference to the flag.
BUG=356540
Committed: https://crrev.com/4727025e0b53a0613eb5c90d6ddcba39643476d1
Cr-Commit-Position: refs/heads/master@{#304681}
Patch Set 1 #
Total comments: 4
Messages
Total messages: 17 (3 generated)
|