DescriptionTaskScheduler: Don't delete Tasks in the scope of a Sequence's lock.
Currently, Sequence::PopTask() deletes a Task within the scope of
the Sequence's lock. This is bad because:
- A deadlock occurs if the Task's destructor tries to post a
Task to the same Sequence.
- Multiple locks are held at the same time if the Task's destructor
tries to post a task to another Sequence.
- The Sequence's lock can't be acquired by another thread while
the Task's destructor runs (unnecessary contention).
With this CL, Sequence::PopTask() releases its lock before deleting
the popped Task.
BUG=553459
Committed: https://crrev.com/0503a773fdb9a6b7c446560f6f02c70655017cc8
Cr-Commit-Position: refs/heads/master@{#406948}
Patch Set 1 #
Total comments: 6
Patch Set 2 : CR robliao, gab #3-4 #
Total comments: 2
Patch Set 3 : CR robliao #6 (initialize variable at declaration) #
Messages
Total messages: 13 (4 generated)
|