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

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

Issue 1708773002: TaskScheduler [7] SchedulerThreadPool (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@s_5_worker_thread
Patch Set: self review Created 4 years, 8 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_PRIORITY_QUEUE_H_ 5 #ifndef BASE_TASK_SCHEDULER_PRIORITY_QUEUE_H_
6 #define BASE_TASK_SCHEDULER_PRIORITY_QUEUE_H_ 6 #define BASE_TASK_SCHEDULER_PRIORITY_QUEUE_H_
7 7
8 #include <queue> 8 #include <queue>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 const PriorityQueue* predecessor_priority_queue); 100 const PriorityQueue* predecessor_priority_queue);
101 101
102 ~PriorityQueue(); 102 ~PriorityQueue();
103 103
104 // Begins a Transaction. This method cannot be called on a thread which has an 104 // Begins a Transaction. This method cannot be called on a thread which has an
105 // active Transaction unless the last Transaction created on the thread was 105 // active Transaction unless the last Transaction created on the thread was
106 // for the allowed predecessor specified in the constructor of this 106 // for the allowed predecessor specified in the constructor of this
107 // PriorityQueue. 107 // PriorityQueue.
108 scoped_ptr<Transaction> BeginTransaction(); 108 scoped_ptr<Transaction> BeginTransaction();
109 109
110 const SchedulerLock* container_lock() const { return &container_lock_; }
111
110 private: 112 private:
111 struct SequenceAndSortKeyComparator { 113 struct SequenceAndSortKeyComparator {
112 bool operator()(const scoped_ptr<SequenceAndSortKey>& left, 114 bool operator()(const scoped_ptr<SequenceAndSortKey>& left,
113 const scoped_ptr<SequenceAndSortKey>& right) const { 115 const scoped_ptr<SequenceAndSortKey>& right) const {
114 return left->sort_key < right->sort_key; 116 return left->sort_key < right->sort_key;
115 } 117 }
116 }; 118 };
117 using ContainerType = 119 using ContainerType =
118 std::priority_queue<scoped_ptr<SequenceAndSortKey>, 120 std::priority_queue<scoped_ptr<SequenceAndSortKey>,
119 std::vector<scoped_ptr<SequenceAndSortKey>>, 121 std::vector<scoped_ptr<SequenceAndSortKey>>,
(...skipping 10 matching lines...) Expand all
130 // empty. 132 // empty.
131 const SequenceAndSortKey empty_sequence_and_sort_key_; 133 const SequenceAndSortKey empty_sequence_and_sort_key_;
132 134
133 DISALLOW_COPY_AND_ASSIGN(PriorityQueue); 135 DISALLOW_COPY_AND_ASSIGN(PriorityQueue);
134 }; 136 };
135 137
136 } // namespace internal 138 } // namespace internal
137 } // namespace base 139 } // namespace base
138 140
139 #endif // BASE_TASK_SCHEDULER_PRIORITY_QUEUE_H_ 141 #endif // BASE_TASK_SCHEDULER_PRIORITY_QUEUE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698