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

Side by Side Diff: webrtc/base/task_queue.h

Issue 1981893002: Adds macros to annotate variables and functions used from same thread or queue. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Fix example Created 4 years, 7 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
« no previous file with comments | « no previous file | webrtc/base/thread.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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_
OLDNEW
« no previous file with comments | « no previous file | webrtc/base/thread.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698