niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. |
| 3 | * |
| 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 |
| 6 | * tree. An additional intellectual property rights grant can be found |
| 7 | * in the file PATENTS. All contributing project authors may |
| 8 | * be found in the AUTHORS file in the root of the source tree. |
| 9 | */ |
| 10 | |
| 11 | #if defined(_WIN32) |
phoglund@webrtc.org | a36d75a | 2012-11-14 09:55:04 +0000 | [diff] [blame] | 12 | #include <windows.h> |
| 13 | #include "condition_variable_win.h" |
| 14 | #include "condition_variable_wrapper.h" |
| 15 | #elif defined(WEBRTC_LINUX) || defined(WEBRTC_MAC) |
| 16 | #include <pthread.h> |
| 17 | #include "condition_variable_posix.h" |
| 18 | #include "condition_variable_wrapper.h" |
ajm@google.com | b5c49ff | 2011-08-01 17:04:04 +0000 | [diff] [blame] | 19 | #endif |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 20 | |
| 21 | namespace webrtc { |
phoglund@webrtc.org | a36d75a | 2012-11-14 09:55:04 +0000 | [diff] [blame] | 22 | |
| 23 | ConditionVariableWrapper* ConditionVariableWrapper::CreateConditionVariable() { |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 24 | #if defined(_WIN32) |
phoglund@webrtc.org | a36d75a | 2012-11-14 09:55:04 +0000 | [diff] [blame] | 25 | return new ConditionVariableWindows; |
andrew@webrtc.org | f3b65db | 2012-09-06 18:17:00 +0000 | [diff] [blame] | 26 | #elif defined(WEBRTC_LINUX) || defined(WEBRTC_MAC) |
phoglund@webrtc.org | a36d75a | 2012-11-14 09:55:04 +0000 | [diff] [blame] | 27 | return ConditionVariablePosix::Create(); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 28 | #else |
phoglund@webrtc.org | a36d75a | 2012-11-14 09:55:04 +0000 | [diff] [blame] | 29 | return NULL; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 30 | #endif |
| 31 | } |
phoglund@webrtc.org | a36d75a | 2012-11-14 09:55:04 +0000 | [diff] [blame] | 32 | |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 33 | } // namespace webrtc |