[llvm-commits] [llvm] r73550 - /llvm/trunk/lib/System/Win32/RWMutex.inc

Owen Anderson resistor at mac.com
Tue Jun 16 13:49:20 PDT 2009


Author: resistor
Date: Tue Jun 16 15:49:20 2009
New Revision: 73550

URL: http://llvm.org/viewvc/llvm-project?rev=73550&view=rev
Log:
Remove the Win32 implementation, since it doesn't compile pre-Vista.

Modified:
    llvm/trunk/lib/System/Win32/RWMutex.inc

Modified: llvm/trunk/lib/System/Win32/RWMutex.inc
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/System/Win32/RWMutex.inc?rev=73550&r1=73549&r2=73550&view=diff

==============================================================================
--- llvm/trunk/lib/System/Win32/RWMutex.inc (original)
+++ llvm/trunk/lib/System/Win32/RWMutex.inc Tue Jun 16 15:49:20 2009
@@ -18,36 +18,31 @@
 
 #include "Win32.h"
 
+// FIXME: THIS IS NOT THREAD-SAFE!!
+// Windows does not have reader-writer locks pre-Vista.  If you want to have
+// thread-safe LLVM on Windows, for now at least, you need to use a pthreads
+// replacement library.
+
 namespace llvm {
 using namespace sys;
 
-RWMutex::RWMutex() {
-  data_ = new PSRWLOCK;
-  InitializeSRWLock((PSRWLOCK*)data_);
-}
+RWMutex::RWMutex() { }
 
-RWMutex::~RWMutex() {
-  delete (PSRWLOCK*)data_;
-  data_ = 0;
-}
+RWMutex::~RWMutex() { }
 
 bool RWMutex::reader_acquire() {
-  AcquireSRWLockShared((PSRWLOCK*)data_);
   return true;
 }
 
 bool RWMutex::reader_release() {
-  ReleaseSRWLockShared((PSRWLOCK*)data_);
   return true;
 }
 
 bool RWMutex::writer_acquire() {
-  AcquireSRWLockExclusive((PSRWLOCK*)data_);
   return true;
 }
 
 bool RWMutex::writer_release() {
-  ReleaseSRWLockExclusive((PSRWLOCK*)data_);
   return true;
 }
 





More information about the llvm-commits mailing list