1 /* 2 * Copyright (c) 2012 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 "rtc_base/synchronization/rw_lock_win.h" 12 13 #include "rtc_base/logging.h" 14 15 namespace webrtc { 16 RWLockWin()17RWLockWin::RWLockWin() { 18 InitializeSRWLock(&lock_); 19 } 20 Create()21RWLockWin* RWLockWin::Create() { 22 return new RWLockWin(); 23 } 24 AcquireLockExclusive()25void RWLockWin::AcquireLockExclusive() { 26 AcquireSRWLockExclusive(&lock_); 27 } 28 ReleaseLockExclusive()29void RWLockWin::ReleaseLockExclusive() { 30 ReleaseSRWLockExclusive(&lock_); 31 } 32 AcquireLockShared()33void RWLockWin::AcquireLockShared() { 34 AcquireSRWLockShared(&lock_); 35 } 36 ReleaseLockShared()37void RWLockWin::ReleaseLockShared() { 38 ReleaseSRWLockShared(&lock_); 39 } 40 41 } // namespace webrtc 42