niklase@google.com | 470e71d | 2011-07-07 08:21:25 | [diff] [blame] | 1 | /* |
henrike@webrtc.org | 9f84723 | 2012-09-25 20:27:51 | [diff] [blame] | 2 | * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 | [diff] [blame] | 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 | |
phoglund@webrtc.org | 59ad541 | 2012-12-18 15:20:35 | [diff] [blame] | 11 | #ifndef WEBRTC_SYSTEM_WRAPPERS_SOURCE_RW_LOCK_WIN_H_ |
| 12 | #define WEBRTC_SYSTEM_WRAPPERS_SOURCE_RW_LOCK_WIN_H_ |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 | [diff] [blame] | 13 | |
phoglund@webrtc.org | 59ad541 | 2012-12-18 15:20:35 | [diff] [blame] | 14 | #include "webrtc/system_wrappers/interface/rw_lock_wrapper.h" |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 | [diff] [blame] | 15 | |
| 16 | #include <Windows.h> |
| 17 | |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 | [diff] [blame] | 18 | namespace webrtc { |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 | [diff] [blame] | 19 | |
henrike@webrtc.org | 9f84723 | 2012-09-25 20:27:51 | [diff] [blame] | 20 | class RWLockWin : public RWLockWrapper { |
| 21 | public: |
| 22 | static RWLockWin* Create(); |
| 23 | ~RWLockWin() {} |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 | [diff] [blame] | 24 | |
henrike@webrtc.org | 9f84723 | 2012-09-25 20:27:51 | [diff] [blame] | 25 | virtual void AcquireLockExclusive(); |
| 26 | virtual void ReleaseLockExclusive(); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 | [diff] [blame] | 27 | |
henrike@webrtc.org | 9f84723 | 2012-09-25 20:27:51 | [diff] [blame] | 28 | virtual void AcquireLockShared(); |
| 29 | virtual void ReleaseLockShared(); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 | [diff] [blame] | 30 | |
henrike@webrtc.org | 9f84723 | 2012-09-25 20:27:51 | [diff] [blame] | 31 | private: |
| 32 | RWLockWin(); |
| 33 | static bool LoadModule(); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 | [diff] [blame] | 34 | |
henrike@webrtc.org | 9f84723 | 2012-09-25 20:27:51 | [diff] [blame] | 35 | SRWLOCK lock_; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 | [diff] [blame] | 36 | }; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 | [diff] [blame] | 37 | |
henrike@webrtc.org | 9f84723 | 2012-09-25 20:27:51 | [diff] [blame] | 38 | } // namespace webrtc |
| 39 | |
phoglund@webrtc.org | 59ad541 | 2012-12-18 15:20:35 | [diff] [blame] | 40 | #endif // WEBRTC_SYSTEM_WRAPPERS_SOURCE_RW_LOCK_WIN_H_ |