DescriptionMaking AsyncInvoker destructor thread-safe.
The documentation for AsyncInvoker states that it owns the lifetime of
calls, and when its destructor is called, all in-flight calls are
cancelled or finish executing. The "cancelled" part is working, but if
a call is in the middle of executing, the destructor does *not* wait.
This is fixed by keeping a count of pending invocations, which is
decremented when a call is either cleared from a message queue or
finishes executing.
BUG=webrtc:3914, webrtc:3911
Review-Url: https://codereview.webrtc.org/2694723004
Cr-Commit-Position: refs/heads/master@{#16811}
Committed: https://chromium.googlesource.com/external/webrtc/+/162cb53e7b6b892ef5201c5ce242520694bab9c1
Patch Set 1 #Patch Set 2 : Adding back suppressions for races that seem to still exist. #Patch Set 3 : Fixing deadlock in ThreeThreadsTest #Patch Set 4 : Fixing a rare potential deadlock. #Patch Set 5 : Switch to MessageQueueManager::Clear, for when multiple threads are blocked. #
Total comments: 7
Patch Set 6 : Merge with master #
Messages
Total messages: 32 (19 generated)
|