OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2011 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 |
11 #ifndef WEBRTC_SYSTEM_WRAPPERS_INCLUDE_CONDITION_VARIABLE_WRAPPER_H_ | 11 #ifndef WEBRTC_SYSTEM_WRAPPERS_INCLUDE_CONDITION_VARIABLE_WRAPPER_H_ |
12 #define WEBRTC_SYSTEM_WRAPPERS_INCLUDE_CONDITION_VARIABLE_WRAPPER_H_ | 12 #define WEBRTC_SYSTEM_WRAPPERS_INCLUDE_CONDITION_VARIABLE_WRAPPER_H_ |
13 | 13 |
| 14 // TODO(tommi): Remove completely. As is there is still some code for Windows |
| 15 // that relies on ConditionVariableWrapper, but code has been removed on other |
| 16 // platforms. |
| 17 #if defined(WEBRTC_WIN) |
| 18 |
14 namespace webrtc { | 19 namespace webrtc { |
15 | 20 |
16 class CriticalSectionWrapper; | 21 class CriticalSectionWrapper; |
17 | 22 |
18 class ConditionVariableWrapper { | 23 class ConditionVariableWrapper { |
19 public: | 24 public: |
20 // Factory method, constructor disabled. | 25 // Factory method, constructor disabled. |
21 static ConditionVariableWrapper* CreateConditionVariable(); | 26 static ConditionVariableWrapper* CreateConditionVariable(); |
22 | 27 |
23 virtual ~ConditionVariableWrapper() {} | 28 virtual ~ConditionVariableWrapper() {} |
24 | 29 |
25 // Calling thread will atomically release crit_sect and wait until next | 30 // Calling thread will atomically release crit_sect and wait until next |
26 // some other thread calls Wake() or WakeAll(). | 31 // some other thread calls Wake() or WakeAll(). |
27 virtual void SleepCS(CriticalSectionWrapper& crit_sect) = 0; | 32 virtual void SleepCS(CriticalSectionWrapper& crit_sect) = 0; |
28 | 33 |
29 // Same as above but with a timeout. | 34 // Same as above but with a timeout. |
30 virtual bool SleepCS(CriticalSectionWrapper& crit_sect, | 35 virtual bool SleepCS(CriticalSectionWrapper& crit_sect, |
31 unsigned long max_time_in_ms) = 0; | 36 unsigned long max_time_in_ms) = 0; |
32 | 37 |
33 // Wakes one thread calling SleepCS(). | 38 // Wakes one thread calling SleepCS(). |
34 virtual void Wake() = 0; | 39 virtual void Wake() = 0; |
35 | 40 |
36 // Wakes all threads calling SleepCS(). | 41 // Wakes all threads calling SleepCS(). |
37 virtual void WakeAll() = 0; | 42 virtual void WakeAll() = 0; |
38 }; | 43 }; |
39 | 44 |
40 } // namespace webrtc | 45 } // namespace webrtc |
41 | 46 |
| 47 #endif // defined(WEBRTC_WIN) |
| 48 |
42 #endif // WEBRTC_SYSTEM_WRAPPERS_INCLUDE_CONDITION_VARIABLE_WRAPPER_H_ | 49 #endif // WEBRTC_SYSTEM_WRAPPERS_INCLUDE_CONDITION_VARIABLE_WRAPPER_H_ |
OLD | NEW |