Owen Anderson | 0c2185a | 2009-06-16 20:19:28 +0000 | [diff] [blame] | 1 | //= llvm/System/Win32/Mutex.inc - Win32 Reader/Writer Mutual Exclusion Lock =// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | // |
| 10 | // This file implements the Win32 specific (non-pthread) RWMutex class. |
| 11 | // |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | |
| 14 | //===----------------------------------------------------------------------===// |
| 15 | //=== WARNING: Implementation here must contain only generic Win32 code that |
| 16 | //=== is guaranteed to work on *all* Win32 variants. |
| 17 | //===----------------------------------------------------------------------===// |
| 18 | |
| 19 | #include "Win32.h" |
| 20 | |
Owen Anderson | 4a04e64 | 2009-06-16 20:49:20 +0000 | [diff] [blame] | 21 | // FIXME: THIS IS NOT THREAD-SAFE!! |
| 22 | // Windows does not have reader-writer locks pre-Vista. If you want to have |
| 23 | // thread-safe LLVM on Windows, for now at least, you need to use a pthreads |
| 24 | // replacement library. |
| 25 | |
Owen Anderson | 0c2185a | 2009-06-16 20:19:28 +0000 | [diff] [blame] | 26 | namespace llvm { |
| 27 | using namespace sys; |
| 28 | |
Owen Anderson | 4a04e64 | 2009-06-16 20:49:20 +0000 | [diff] [blame] | 29 | RWMutex::RWMutex() { } |
Owen Anderson | 0c2185a | 2009-06-16 20:19:28 +0000 | [diff] [blame] | 30 | |
Owen Anderson | 4a04e64 | 2009-06-16 20:49:20 +0000 | [diff] [blame] | 31 | RWMutex::~RWMutex() { } |
Owen Anderson | 0c2185a | 2009-06-16 20:19:28 +0000 | [diff] [blame] | 32 | |
| 33 | bool RWMutex::reader_acquire() { |
Owen Anderson | 0c2185a | 2009-06-16 20:19:28 +0000 | [diff] [blame] | 34 | return true; |
| 35 | } |
| 36 | |
| 37 | bool RWMutex::reader_release() { |
Owen Anderson | 0c2185a | 2009-06-16 20:19:28 +0000 | [diff] [blame] | 38 | return true; |
| 39 | } |
| 40 | |
| 41 | bool RWMutex::writer_acquire() { |
Owen Anderson | 0c2185a | 2009-06-16 20:19:28 +0000 | [diff] [blame] | 42 | return true; |
| 43 | } |
| 44 | |
| 45 | bool RWMutex::writer_release() { |
Owen Anderson | 0c2185a | 2009-06-16 20:19:28 +0000 | [diff] [blame] | 46 | return true; |
| 47 | } |
| 48 | |
| 49 | |
| 50 | } |