Chromium Code Reviews| Index: base/task_scheduler/sequence.h |
| diff --git a/base/task_scheduler/sequence.h b/base/task_scheduler/sequence.h |
| index b77576b4aaeea21f23e8ce646a365722c5c43e65..5cc60c4e3f617a2bd3e06e89d9dc2f44a54cea03 100644 |
| --- a/base/task_scheduler/sequence.h |
| +++ b/base/task_scheduler/sequence.h |
| @@ -22,6 +22,20 @@ namespace base { |
| namespace internal { |
| // A sequence holds tasks that must be executed in posting order. |
| +// |
| +// Note: there is a known refcounted-ownership cycle in the Scheduler |
| +// architecture: |
| +// Sequence -> Task -> TaskRunner -> Sequence -> ... |
| +// this is okay so long as the other owners of Sequence (PriorityQueue and |
|
danakj
2016/04/29 22:36:34
"This"
gab
2016/05/02 14:36:53
Done.
|
| +// SchedulerWorkerThread in alternance and |
| +// SchedulerThreadPoolImpl::SchedulerWorkerThreadDelegateImpl::GetWork() |
| +// temporarily) keep running it (and taking Tasks from it as a result). A |
| +// dangling reference cycle would only occur should they release their reference |
| +// to it while it's not empty. In other words, it is only correct for them to |
| +// release it after PopTask() returns false to indicate it was made empty by |
| +// that call (in which case the next PushTask() will return true to indicate to |
| +// the caller that the Sequence should be re-enqueued for execution). |
| +// |
| // This class is thread-safe. |
| class BASE_EXPORT Sequence : public RefCountedThreadSafe<Sequence> { |
| public: |