OLD | NEW |
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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 Runnable() {} | 95 Runnable() {} |
96 | 96 |
97 private: | 97 private: |
98 RTC_DISALLOW_COPY_AND_ASSIGN(Runnable); | 98 RTC_DISALLOW_COPY_AND_ASSIGN(Runnable); |
99 }; | 99 }; |
100 | 100 |
101 // WARNING! SUBCLASSES MUST CALL Stop() IN THEIR DESTRUCTORS! See ~Thread(). | 101 // WARNING! SUBCLASSES MUST CALL Stop() IN THEIR DESTRUCTORS! See ~Thread(). |
102 | 102 |
103 class LOCKABLE Thread : public MessageQueue { | 103 class LOCKABLE Thread : public MessageQueue { |
104 public: | 104 public: |
105 // Create a new Thread and optionally assign it to the passed SocketServer. | 105 // DEPRECATED. |
| 106 // The default constructor should not be used because it hides whether or |
| 107 // not a socket server will be associated with the thread. Most instances |
| 108 // of Thread do actually not need one, so please use either of the Create* |
| 109 // methods to construct an instance of Thread. |
106 Thread(); | 110 Thread(); |
| 111 |
107 explicit Thread(SocketServer* ss); | 112 explicit Thread(SocketServer* ss); |
108 explicit Thread(std::unique_ptr<SocketServer> ss); | 113 explicit Thread(std::unique_ptr<SocketServer> ss); |
109 | 114 |
110 // NOTE: ALL SUBCLASSES OF Thread MUST CALL Stop() IN THEIR DESTRUCTORS (or | 115 // NOTE: ALL SUBCLASSES OF Thread MUST CALL Stop() IN THEIR DESTRUCTORS (or |
111 // guarantee Stop() is explicitly called before the subclass is destroyed). | 116 // guarantee Stop() is explicitly called before the subclass is destroyed). |
112 // This is required to avoid a data race between the destructor modifying the | 117 // This is required to avoid a data race between the destructor modifying the |
113 // vtable, and the Thread::PreRun calling the virtual method Run(). | 118 // vtable, and the Thread::PreRun calling the virtual method Run(). |
114 ~Thread() override; | 119 ~Thread() override; |
115 | 120 |
116 static std::unique_ptr<Thread> CreateWithSocketServer(); | 121 static std::unique_ptr<Thread> CreateWithSocketServer(); |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
323 | 328 |
324 private: | 329 private: |
325 rtc::Thread* old_thread_; | 330 rtc::Thread* old_thread_; |
326 | 331 |
327 RTC_DISALLOW_COPY_AND_ASSIGN(AutoSocketServerThread); | 332 RTC_DISALLOW_COPY_AND_ASSIGN(AutoSocketServerThread); |
328 }; | 333 }; |
329 | 334 |
330 } // namespace rtc | 335 } // namespace rtc |
331 | 336 |
332 #endif // WEBRTC_RTC_BASE_THREAD_H_ | 337 #endif // WEBRTC_RTC_BASE_THREAD_H_ |
OLD | NEW |