• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 #include "rw_lock_wrapper.h"
12 
13 #include <assert.h>
14 
15 #if defined(_WIN32)
16     #include "rw_lock_win.h"
17 #elif defined(WEBRTC_ANDROID)
18     #include <stdlib.h>
19     #include "rw_lock_generic.h"
20 #else
21     #include "rw_lock_posix.h"
22 #endif
23 
24 namespace webrtc {
CreateRWLock()25 RWLockWrapper* RWLockWrapper::CreateRWLock()
26 {
27 #ifdef _WIN32
28     RWLockWrapper* lock =  new RWLockWindows();
29 #elif defined(WEBRTC_ANDROID)
30     RWLockWrapper* lock =  new RWLockWrapperGeneric();
31 #else
32     RWLockWrapper* lock =  new RWLockPosix();
33 #endif
34     if(lock->Init() != 0)
35     {
36         delete lock;
37         assert(false);
38         return NULL;
39     }
40     return lock;
41 }
42 
~RWLockWrapper()43 RWLockWrapper::~RWLockWrapper()
44 {
45 }
46 } // namespace webrtc
47