deadbeef
3af63b0dc9
Fixing race between ~AsyncInvoker and ~AsyncClosure, using ref-counting.
...
The AsyncInvoker destructor waits for all invoked tasks to be complete
(in other words, all AsyncClosures to be destructed). They were using an
event to wake up the destructor, but a race made it possible for this
event to be dereferenced after it's destroyed.
This CL makes the event reference counted, such that if the destructor
runs right after AsyncClosure decrements "pending_invocations_",
setting the event will be a no-op, and the event will be destructed
in the AsyncClosure destructor.
This CL also fixes a deadlock that may occur for "re-entrant"
invocations. The deadlock occurs if the AsyncInvoker is destroyed on
thread A while a task on thread B is running, which AsyncInvokes a task
back on thread A.
This was causing pending_invocations_ to end up negative, because
an AsyncClosure that's never added to a thread's message queue (due to
the "destroying_" flag) caused the count to be decremented but not
incremented.
BUG=webrtc:7656
Review-Url: https://codereview.webrtc.org/2885143005
Cr-Commit-Position: refs/heads/master@{#19278}
2017-08-09 00:59:47 +00:00
..
2017-07-07 10:09:51 +00:00
2017-06-30 17:45:21 +00:00
2017-07-07 10:09:51 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-29 06:04:25 +00:00
2017-08-09 00:59:47 +00:00
2017-08-09 00:59:47 +00:00
2017-08-09 00:59:47 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-29 06:04:25 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-29 06:04:25 +00:00
2017-06-30 17:45:21 +00:00
2017-06-29 06:04:25 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-07-19 17:40:47 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-07-19 17:40:47 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-29 06:04:25 +00:00
2017-06-29 06:04:25 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-29 06:04:25 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-07-14 21:44:46 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-29 06:04:25 +00:00
2017-06-29 06:04:25 +00:00
2017-06-29 06:04:25 +00:00
2017-06-29 06:04:25 +00:00
2017-06-21 12:50:22 +00:00
2017-06-30 17:45:21 +00:00
2017-07-07 18:02:15 +00:00
2017-06-29 06:04:25 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-29 06:04:25 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-29 06:04:25 +00:00
2017-06-29 06:04:25 +00:00
2017-07-10 10:00:30 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-29 06:04:25 +00:00
2017-06-29 06:04:25 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-29 06:04:25 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-07-07 10:09:51 +00:00
2017-07-14 21:44:46 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-29 06:04:25 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-29 06:04:25 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-29 06:04:25 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-29 06:04:25 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-07-14 21:44:46 +00:00
2017-07-11 23:56:05 +00:00
2017-07-11 23:56:05 +00:00
2017-07-26 14:48:15 +00:00
2017-07-26 14:48:15 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-29 06:04:25 +00:00
2017-07-11 23:56:05 +00:00
2017-07-11 23:56:05 +00:00
2017-07-27 22:05:29 +00:00
2017-07-27 22:05:29 +00:00
2017-07-26 23:09:33 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-29 06:04:25 +00:00
2017-07-14 21:44:46 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-29 06:04:25 +00:00
2017-07-21 00:10:31 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-29 06:04:25 +00:00
2017-06-29 06:04:25 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-07-14 21:44:46 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-29 06:04:25 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-29 06:04:25 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-29 06:04:25 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-29 06:04:25 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-07-14 21:44:46 +00:00
2017-08-08 17:48:15 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-29 06:04:25 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-29 06:04:25 +00:00
2017-06-29 06:04:25 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-29 06:04:25 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-07-19 17:40:47 +00:00
2017-07-19 17:40:47 +00:00
2017-07-19 17:40:47 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-07-19 17:40:47 +00:00
2017-07-14 21:44:46 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-08-08 17:48:15 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-29 06:04:25 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-29 06:04:25 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-29 06:04:25 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-29 06:04:25 +00:00
2017-06-29 06:04:25 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-29 06:04:25 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-07-14 21:44:46 +00:00
2017-06-30 17:45:21 +00:00
2017-07-07 10:09:51 +00:00
2017-08-09 00:59:47 +00:00
2017-07-14 21:44:46 +00:00
2017-07-14 21:44:46 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-07-14 21:44:46 +00:00
2017-06-30 17:45:21 +00:00
2017-07-14 22:26:05 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-29 06:04:25 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-08-04 22:01:57 +00:00
2017-08-04 22:01:57 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-29 06:04:25 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-29 06:04:25 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00
2017-06-30 17:45:21 +00:00