Descriptionscheduler: Don't access weak pointers on foreign threads
The Task Queue Manager previously would give clients a
SingleThreadTaskRunner which held a weak pointer back to the manager in
order to post tasks. This is wrong because the task runner and hence
the weak pointer may be accessed from arbitrary threads, which is
not safe.
This patch corrects the problem by combining the task runner and the
incoming task queue into a single task queue object which owns both
the incoming task as well as the pointer back to the task queue
manager. This allows us to protect the incoming task queue and the
pointer using the same lock.
BUG=391005
Committed: https://crrev.com/b03818a3791ae90d3cf7014de69bfe44f831d192
Cr-Commit-Position: refs/heads/master@{#301085}
Patch Set 1 #Patch Set 2 : Added test. #
Total comments: 6
Patch Set 3 : Ross's comments. #
Messages
Total messages: 12 (3 generated)
|