OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2016 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2016 The WebRTC Project Authors. All rights reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 // int count_ = 0; | 147 // int count_ = 0; |
148 // }; | 148 // }; |
149 // ... | 149 // ... |
150 // queue_.PostDelayedTask( | 150 // queue_.PostDelayedTask( |
151 // std::unique_ptr<QueuedTask>(new TimerTask()), 1000); | 151 // std::unique_ptr<QueuedTask>(new TimerTask()), 1000); |
152 // | 152 // |
153 // For more examples, see task_queue_unittests.cc. | 153 // For more examples, see task_queue_unittests.cc. |
154 // | 154 // |
155 // A note on destruction: | 155 // A note on destruction: |
156 // | 156 // |
| 157 // The first sentence here is in contradiction with the current implementation: |
157 // When a TaskQueue is deleted, pending tasks will not be executed but they will | 158 // When a TaskQueue is deleted, pending tasks will not be executed but they will |
158 // be deleted. The deletion of tasks may happen asynchronously after the | 159 // be deleted. The deletion of tasks may happen asynchronously after the |
159 // TaskQueue itself has been deleted or it may happen synchronously while the | 160 // TaskQueue itself has been deleted or it may happen synchronously while the |
160 // TaskQueue instance is being deleted. This may vary from one OS to the next | 161 // TaskQueue instance is being deleted. This may vary from one OS to the next |
161 // so assumptions about lifetimes of pending tasks should not be made. | 162 // so assumptions about lifetimes of pending tasks should not be made. |
162 class LOCKABLE TaskQueue { | 163 class LOCKABLE TaskQueue { |
163 public: | 164 public: |
164 // TaskQueue priority levels. On some platforms these will map to thread | 165 // TaskQueue priority levels. On some platforms these will map to thread |
165 // priorities, on others such as Mac and iOS, GCD queue priorities. | 166 // priorities, on others such as Mac and iOS, GCD queue priorities. |
166 enum class Priority { | 167 enum class Priority { |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 #else | 298 #else |
298 #error not supported. | 299 #error not supported. |
299 #endif | 300 #endif |
300 | 301 |
301 RTC_DISALLOW_COPY_AND_ASSIGN(TaskQueue); | 302 RTC_DISALLOW_COPY_AND_ASSIGN(TaskQueue); |
302 }; | 303 }; |
303 | 304 |
304 } // namespace rtc | 305 } // namespace rtc |
305 | 306 |
306 #endif // WEBRTC_RTC_BASE_TASK_QUEUE_H_ | 307 #endif // WEBRTC_RTC_BASE_TASK_QUEUE_H_ |
OLD | NEW |