2015-02-07 22:35:54 +00:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
|
|
|
|
|
*
|
|
|
|
|
* Use of this source code is governed by a BSD-style license
|
|
|
|
|
* that can be found in the LICENSE file in the root of the source
|
|
|
|
|
* tree. An additional intellectual property rights grant can be found
|
|
|
|
|
* in the file PATENTS. All contributing project authors may
|
|
|
|
|
* be found in the AUTHORS file in the root of the source tree.
|
|
|
|
|
*/
|
|
|
|
|
|
2018-03-23 14:53:54 +01:00
|
|
|
#include "rtc_base/synchronization/rw_lock_win.h"
|
2015-02-07 22:35:54 +00:00
|
|
|
|
2017-10-02 13:48:55 +02:00
|
|
|
#include "rtc_base/logging.h"
|
2015-02-07 22:35:54 +00:00
|
|
|
|
|
|
|
|
namespace webrtc {
|
|
|
|
|
|
|
|
|
|
RWLockWin::RWLockWin() {
|
2019-12-09 09:34:49 -08:00
|
|
|
InitializeSRWLock(&lock_);
|
2015-02-07 22:35:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
RWLockWin* RWLockWin::Create() {
|
|
|
|
|
return new RWLockWin();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void RWLockWin::AcquireLockExclusive() {
|
2019-12-09 09:34:49 -08:00
|
|
|
AcquireSRWLockExclusive(&lock_);
|
2015-02-07 22:35:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void RWLockWin::ReleaseLockExclusive() {
|
2019-12-09 09:34:49 -08:00
|
|
|
ReleaseSRWLockExclusive(&lock_);
|
2015-02-07 22:35:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void RWLockWin::AcquireLockShared() {
|
2019-12-09 09:34:49 -08:00
|
|
|
AcquireSRWLockShared(&lock_);
|
2015-02-07 22:35:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void RWLockWin::ReleaseLockShared() {
|
2019-12-09 09:34:49 -08:00
|
|
|
ReleaseSRWLockShared(&lock_);
|
2015-02-07 22:35:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} // namespace webrtc
|