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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 virtual ~Runnable() {} | 84 virtual ~Runnable() {} |
85 virtual void Run(Thread* thread) = 0; | 85 virtual void Run(Thread* thread) = 0; |
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 struct ThreadInit { |
| 95 Thread* thread; |
| 96 Runnable* runnable; |
| 97 }; |
| 98 |
| 99 |
94 // WARNING! SUBCLASSES MUST CALL Stop() IN THEIR DESTRUCTORS! See ~Thread(). | 100 // WARNING! SUBCLASSES MUST CALL Stop() IN THEIR DESTRUCTORS! See ~Thread(). |
95 | 101 |
96 class LOCKABLE Thread : public MessageQueue { | 102 class LOCKABLE Thread : public MessageQueue { |
97 public: | 103 public: |
98 // Create a new Thread and optionally assign it to the passed SocketServer. | 104 // Create a new Thread and optionally assign it to the passed SocketServer. |
99 Thread(); | 105 Thread(); |
100 explicit Thread(SocketServer* ss); | 106 explicit Thread(SocketServer* ss); |
101 explicit Thread(std::unique_ptr<SocketServer> ss); | 107 explicit Thread(std::unique_ptr<SocketServer> ss); |
102 | 108 |
103 // NOTE: ALL SUBCLASSES OF Thread MUST CALL Stop() IN THEIR DESTRUCTORS (or | 109 // NOTE: ALL SUBCLASSES OF Thread MUST CALL Stop() IN THEIR DESTRUCTORS (or |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
329 | 335 |
330 private: | 336 private: |
331 SocketServer* old_ss_; | 337 SocketServer* old_ss_; |
332 | 338 |
333 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(SocketServerScope); | 339 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(SocketServerScope); |
334 }; | 340 }; |
335 | 341 |
336 } // namespace rtc | 342 } // namespace rtc |
337 | 343 |
338 #endif // WEBRTC_BASE_THREAD_H_ | 344 #endif // WEBRTC_BASE_THREAD_H_ |
OLD | NEW |