Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(545)

Side by Side Diff: base/task_scheduler/sequence.h

Issue 2068853002: Rename SchedulerThreadPool* to SchedulerWorkerPool* (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@rename1
Patch Set: CR Feedback fdoray@ Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef BASE_TASK_SCHEDULER_SEQUENCE_H_ 5 #ifndef BASE_TASK_SCHEDULER_SEQUENCE_H_
6 #define BASE_TASK_SCHEDULER_SEQUENCE_H_ 6 #define BASE_TASK_SCHEDULER_SEQUENCE_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <memory> 10 #include <memory>
11 #include <queue> 11 #include <queue>
12 12
13 #include "base/base_export.h" 13 #include "base/base_export.h"
14 #include "base/macros.h" 14 #include "base/macros.h"
15 #include "base/memory/ref_counted.h" 15 #include "base/memory/ref_counted.h"
16 #include "base/task_scheduler/scheduler_lock.h" 16 #include "base/task_scheduler/scheduler_lock.h"
17 #include "base/task_scheduler/sequence_sort_key.h" 17 #include "base/task_scheduler/sequence_sort_key.h"
18 #include "base/task_scheduler/task.h" 18 #include "base/task_scheduler/task.h"
19 #include "base/task_scheduler/task_traits.h" 19 #include "base/task_scheduler/task_traits.h"
20 20
21 namespace base { 21 namespace base {
22 namespace internal { 22 namespace internal {
23 23
24 // A sequence holds tasks that must be executed in posting order. 24 // A sequence holds tasks that must be executed in posting order.
25 // 25 //
26 // Note: there is a known refcounted-ownership cycle in the Scheduler 26 // Note: there is a known refcounted-ownership cycle in the Scheduler
27 // architecture: Sequence -> Task -> TaskRunner -> Sequence -> ... 27 // architecture: Sequence -> Task -> TaskRunner -> Sequence -> ...
28 // This is okay so long as the other owners of Sequence (PriorityQueue and 28 // This is okay so long as the other owners of Sequence (PriorityQueue and
29 // SchedulerWorkerThread in alternance and 29 // SchedulerWorkerThread in alternance and
30 // SchedulerThreadPoolImpl::SchedulerWorkerThreadDelegateImpl::GetWork() 30 // SchedulerWorkerPoolImpl::SchedulerWorkerThreadDelegateImpl::GetWork()
31 // temporarily) keep running it (and taking Tasks from it as a result). A 31 // temporarily) keep running it (and taking Tasks from it as a result). A
32 // dangling reference cycle would only occur should they release their reference 32 // dangling reference cycle would only occur should they release their reference
33 // to it while it's not empty. In other words, it is only correct for them to 33 // to it while it's not empty. In other words, it is only correct for them to
34 // release it after PopTask() returns false to indicate it was made empty by 34 // release it after PopTask() returns false to indicate it was made empty by
35 // that call (in which case the next PushTask() will return true to indicate to 35 // that call (in which case the next PushTask() will return true to indicate to
36 // the caller that the Sequence should be re-enqueued for execution). 36 // the caller that the Sequence should be re-enqueued for execution).
37 // 37 //
38 // This class is thread-safe. 38 // This class is thread-safe.
39 class BASE_EXPORT Sequence : public RefCountedThreadSafe<Sequence> { 39 class BASE_EXPORT Sequence : public RefCountedThreadSafe<Sequence> {
40 public: 40 public:
(...skipping 29 matching lines...) Expand all
70 size_t num_tasks_per_priority_[static_cast<int>(TaskPriority::HIGHEST) + 1] = 70 size_t num_tasks_per_priority_[static_cast<int>(TaskPriority::HIGHEST) + 1] =
71 {}; 71 {};
72 72
73 DISALLOW_COPY_AND_ASSIGN(Sequence); 73 DISALLOW_COPY_AND_ASSIGN(Sequence);
74 }; 74 };
75 75
76 } // namespace internal 76 } // namespace internal
77 } // namespace base 77 } // namespace base
78 78
79 #endif // BASE_TASK_SCHEDULER_SEQUENCE_H_ 79 #endif // BASE_TASK_SCHEDULER_SEQUENCE_H_
OLDNEW
« no previous file with comments | « base/task_scheduler/scheduler_worker_pool_impl_unittest.cc ('k') | base/task_scheduler/task_scheduler_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698