1 //= llvm/System/Win32/Mutex.inc - Win32 Reader/Writer Mutual Exclusion Lock =//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file implements the Win32 specific (non-pthread) RWMutex class.
12 //===----------------------------------------------------------------------===//
14 //===----------------------------------------------------------------------===//
15 //=== WARNING: Implementation here must contain only generic Win32 code that
16 //=== is guaranteed to work on *all* Win32 variants.
17 //===----------------------------------------------------------------------===//
26 InitializeSRWLock((PSRWLOCK*)data_);
30 delete (PSRWLOCK*)data_;
34 bool RWMutex::reader_acquire() {
35 AcquireSRWLockShared((PSRWLOCK*)data_);
39 bool RWMutex::reader_release() {
40 ReleaseSRWLockShared((PSRWLOCK*)data_);
44 bool RWMutex::writer_acquire() {
45 AcquireSRWLockExclusive((PSRWLOCK*)data_);
49 bool RWMutex::writer_release() {
50 ReleaseSRWLockExclusive((PSRWLOCK*)data_);