tommi@webrtc.org | fe19699 | 2015-02-07 22:35:54 +0000 | [diff] [blame] | 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 | |
Karl Wiberg | 2b85792 | 2018-03-23 14:53:54 +0100 | [diff] [blame] | 11 | #ifndef RTC_BASE_SYNCHRONIZATION_RW_LOCK_WIN_H_ |
| 12 | #define RTC_BASE_SYNCHRONIZATION_RW_LOCK_WIN_H_ |
tommi@webrtc.org | fe19699 | 2015-02-07 22:35:54 +0000 | [diff] [blame] | 13 | |
tommi@webrtc.org | fe19699 | 2015-02-07 22:35:54 +0000 | [diff] [blame] | 14 | #include <Windows.h> |
| 15 | |
Jonas Olsson | a4d8737 | 2019-07-05 19:08:33 +0200 | [diff] [blame] | 16 | #include "rtc_base/synchronization/rw_lock_wrapper.h" |
| 17 | |
tommi@webrtc.org | fe19699 | 2015-02-07 22:35:54 +0000 | [diff] [blame] | 18 | namespace webrtc { |
| 19 | |
| 20 | class RWLockWin : public RWLockWrapper { |
| 21 | public: |
| 22 | static RWLockWin* Create(); |
tommi@webrtc.org | fe19699 | 2015-02-07 22:35:54 +0000 | [diff] [blame] | 23 | |
Karl Wiberg | 2b85792 | 2018-03-23 14:53:54 +0100 | [diff] [blame] | 24 | void AcquireLockExclusive() override; |
| 25 | void ReleaseLockExclusive() override; |
tommi@webrtc.org | fe19699 | 2015-02-07 22:35:54 +0000 | [diff] [blame] | 26 | |
Karl Wiberg | 2b85792 | 2018-03-23 14:53:54 +0100 | [diff] [blame] | 27 | void AcquireLockShared() override; |
| 28 | void ReleaseLockShared() override; |
tommi@webrtc.org | fe19699 | 2015-02-07 22:35:54 +0000 | [diff] [blame] | 29 | |
| 30 | private: |
| 31 | RWLockWin(); |
| 32 | static bool LoadModule(); |
| 33 | |
| 34 | SRWLOCK lock_; |
| 35 | }; |
| 36 | |
| 37 | } // namespace webrtc |
| 38 | |
Karl Wiberg | 2b85792 | 2018-03-23 14:53:54 +0100 | [diff] [blame] | 39 | #endif // RTC_BASE_SYNCHRONIZATION_RW_LOCK_WIN_H_ |