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) |
| 12 | #include <windows.h> |
| 13 | #include "condition_variable_wrapper.h" |
andrew@webrtc.org | 59ccd5c | 2011-12-15 00:17:43 +0000 | [diff] [blame] | 14 | #include "condition_variable_win.h" |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 15 | #elif defined(WEBRTC_LINUX) |
| 16 | #include <pthread.h> |
| 17 | #include "condition_variable_wrapper.h" |
ajm@google.com | b5c49ff | 2011-08-01 17:04:04 +0000 | [diff] [blame] | 18 | #include "condition_variable_posix.h" |
andrew@webrtc.org | f3b65db | 2012-09-06 18:17:00 +0000 | [diff] [blame^] | 19 | #elif defined(WEBRTC_MAC) |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 20 | #include <pthread.h> |
| 21 | #include "condition_variable_wrapper.h" |
ajm@google.com | b5c49ff | 2011-08-01 17:04:04 +0000 | [diff] [blame] | 22 | #include "condition_variable_posix.h" |
| 23 | #endif |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 24 | |
| 25 | namespace webrtc { |
| 26 | ConditionVariableWrapper* |
| 27 | ConditionVariableWrapper::CreateConditionVariable() |
| 28 | { |
| 29 | #if defined(_WIN32) |
| 30 | return new ConditionVariableWindows; |
andrew@webrtc.org | f3b65db | 2012-09-06 18:17:00 +0000 | [diff] [blame^] | 31 | #elif defined(WEBRTC_LINUX) || defined(WEBRTC_MAC) |
ajm@google.com | b5c49ff | 2011-08-01 17:04:04 +0000 | [diff] [blame] | 32 | return ConditionVariablePosix::Create(); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 33 | #else |
| 34 | return NULL; |
| 35 | #endif |
| 36 | } |
| 37 | } // namespace webrtc |