blob: 6f7cd3344e1781ed73ebb4e36b71e0c6183e63c3 [file] [log] [blame]
niklase@google.com470e71d2011-07-07 08:21:25 +00001/*
henrike@webrtc.org9f847232012-09-25 20:27:51 +00002 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
niklase@google.com470e71d2011-07-07 08:21:25 +00003 *
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.org59ad5412012-12-18 15:20:35 +000011#ifndef WEBRTC_SYSTEM_WRAPPERS_SOURCE_RW_LOCK_WIN_H_
12#define WEBRTC_SYSTEM_WRAPPERS_SOURCE_RW_LOCK_WIN_H_
niklase@google.com470e71d2011-07-07 08:21:25 +000013
phoglund@webrtc.org59ad5412012-12-18 15:20:35 +000014#include "webrtc/system_wrappers/interface/rw_lock_wrapper.h"
niklase@google.com470e71d2011-07-07 08:21:25 +000015
16#include <Windows.h>
17
niklase@google.com470e71d2011-07-07 08:21:25 +000018namespace webrtc {
niklase@google.com470e71d2011-07-07 08:21:25 +000019
henrike@webrtc.org9f847232012-09-25 20:27:51 +000020class RWLockWin : public RWLockWrapper {
21 public:
22 static RWLockWin* Create();
23 ~RWLockWin() {}
niklase@google.com470e71d2011-07-07 08:21:25 +000024
henrike@webrtc.org9f847232012-09-25 20:27:51 +000025 virtual void AcquireLockExclusive();
26 virtual void ReleaseLockExclusive();
niklase@google.com470e71d2011-07-07 08:21:25 +000027
henrike@webrtc.org9f847232012-09-25 20:27:51 +000028 virtual void AcquireLockShared();
29 virtual void ReleaseLockShared();
niklase@google.com470e71d2011-07-07 08:21:25 +000030
henrike@webrtc.org9f847232012-09-25 20:27:51 +000031 private:
32 RWLockWin();
33 static bool LoadModule();
niklase@google.com470e71d2011-07-07 08:21:25 +000034
henrike@webrtc.org9f847232012-09-25 20:27:51 +000035 SRWLOCK lock_;
niklase@google.com470e71d2011-07-07 08:21:25 +000036};
niklase@google.com470e71d2011-07-07 08:21:25 +000037
henrike@webrtc.org9f847232012-09-25 20:27:51 +000038} // namespace webrtc
39
phoglund@webrtc.org59ad5412012-12-18 15:20:35 +000040#endif // WEBRTC_SYSTEM_WRAPPERS_SOURCE_RW_LOCK_WIN_H_