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

Side by Side Diff: webrtc/base/thread.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 | « webrtc/base/task_queue.h ('k') | webrtc/base/thread_annotations.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 2004 The WebRTC Project Authors. All rights reserved. 2 * Copyright 2004 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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 86
87 protected: 87 protected:
88 Runnable() {} 88 Runnable() {}
89 89
90 private: 90 private:
91 RTC_DISALLOW_COPY_AND_ASSIGN(Runnable); 91 RTC_DISALLOW_COPY_AND_ASSIGN(Runnable);
92 }; 92 };
93 93
94 // WARNING! SUBCLASSES MUST CALL Stop() IN THEIR DESTRUCTORS! See ~Thread(). 94 // WARNING! SUBCLASSES MUST CALL Stop() IN THEIR DESTRUCTORS! See ~Thread().
95 95
96 class Thread : public MessageQueue { 96 class LOCKABLE Thread : public MessageQueue {
97 public: 97 public:
98 // Create a new Thread and optionally assign it to the passed SocketServer. 98 // Create a new Thread and optionally assign it to the passed SocketServer.
99 Thread(); 99 Thread();
100 explicit Thread(SocketServer* ss); 100 explicit Thread(SocketServer* ss);
101 explicit Thread(std::unique_ptr<SocketServer> ss); 101 explicit Thread(std::unique_ptr<SocketServer> ss);
102 102
103 // NOTE: ALL SUBCLASSES OF Thread MUST CALL Stop() IN THEIR DESTRUCTORS (or 103 // NOTE: ALL SUBCLASSES OF Thread MUST CALL Stop() IN THEIR DESTRUCTORS (or
104 // guarantee Stop() is explicitly called before the subclass is destroyed). 104 // guarantee Stop() is explicitly called before the subclass is destroyed).
105 // This is required to avoid a data race between the destructor modifying the 105 // This is required to avoid a data race between the destructor modifying the
106 // vtable, and the Thread::PreRun calling the virtual method Run(). 106 // vtable, and the Thread::PreRun calling the virtual method Run().
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 327
328 private: 328 private:
329 SocketServer* old_ss_; 329 SocketServer* old_ss_;
330 330
331 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(SocketServerScope); 331 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(SocketServerScope);
332 }; 332 };
333 333
334 } // namespace rtc 334 } // namespace rtc
335 335
336 #endif // WEBRTC_BASE_THREAD_H_ 336 #endif // WEBRTC_BASE_THREAD_H_
OLDNEW
« no previous file with comments | « webrtc/base/task_queue.h ('k') | webrtc/base/thread_annotations.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698