DescriptionTaskScheduler: Change Sequence::PeekTask to Sequence::TakeTask.
Sequence::TakeTask() transfers ownership of the Task in the front slot of
the Sequence to the caller. This makes the front slot empty. The empty
front slot can be removed with Sequence::RemoveFrontSlot().
Benefits of transfering ownership of a Task to code that runs it:
- The code that runs (and owns) the Task can modify it. This is
important if we want to use OnceClosure in TaskScheduler.
- It is now clear that a single thread has a pointer to a given
Task at a time (before, multiple threads calling PeekTask on
the same Sequence could theoretically get pointers to the same
Task).
BUG=553459
Committed: https://crrev.com/0c97aa3cb8c7710bdbc7d22c260a4d871f41e264
Cr-Commit-Position: refs/heads/master@{#424719}
Patch Set 1 #Patch Set 2 : self-review #
Total comments: 14
Patch Set 3 : CR gab #3 #Patch Set 4 : self-review #
Total comments: 10
Patch Set 5 : CR robliao #5 #Dependent Patchsets: Messages
Total messages: 26 (10 generated)
|