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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 // | 148 // |
149 // For more examples, see task_queue_unittests.cc. | 149 // For more examples, see task_queue_unittests.cc. |
150 // | 150 // |
151 // A note on destruction: | 151 // A note on destruction: |
152 // | 152 // |
153 // When a TaskQueue is deleted, pending tasks will not be executed but they will | 153 // When a TaskQueue is deleted, pending tasks will not be executed but they will |
154 // be deleted. The deletion of tasks may happen asynchronously after the | 154 // be deleted. The deletion of tasks may happen asynchronously after the |
155 // TaskQueue itself has been deleted or it may happen synchronously while the | 155 // TaskQueue itself has been deleted or it may happen synchronously while the |
156 // TaskQueue instance is being deleted. This may vary from one OS to the next | 156 // TaskQueue instance is being deleted. This may vary from one OS to the next |
157 // so assumptions about lifetimes of pending tasks should not be made. | 157 // so assumptions about lifetimes of pending tasks should not be made. |
158 class TaskQueue { | 158 class LOCKABLE TaskQueue { |
159 public: | 159 public: |
160 explicit TaskQueue(const char* queue_name); | 160 explicit TaskQueue(const char* queue_name); |
161 // TODO(tommi): Implement move semantics? | 161 // TODO(tommi): Implement move semantics? |
162 ~TaskQueue(); | 162 ~TaskQueue(); |
163 | 163 |
164 static TaskQueue* Current(); | 164 static TaskQueue* Current(); |
165 | 165 |
166 // Used for DCHECKing the current queue. | 166 // Used for DCHECKing the current queue. |
167 static bool IsCurrent(const char* queue_name); | 167 static bool IsCurrent(const char* queue_name); |
168 bool IsCurrent() const; | 168 bool IsCurrent() const; |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 #else | 268 #else |
269 #error not supported. | 269 #error not supported. |
270 #endif | 270 #endif |
271 | 271 |
272 RTC_DISALLOW_COPY_AND_ASSIGN(TaskQueue); | 272 RTC_DISALLOW_COPY_AND_ASSIGN(TaskQueue); |
273 }; | 273 }; |
274 | 274 |
275 } // namespace rtc | 275 } // namespace rtc |
276 | 276 |
277 #endif // WEBRTC_BASE_TASK_QUEUE_H_ | 277 #endif // WEBRTC_BASE_TASK_QUEUE_H_ |
OLD | NEW |