[llvm-commits] [llvm] r110636 - /llvm/trunk/lib/System/RWMutex.cpp

Chris Lattner sabre at nondot.org
Mon Aug 9 17:34:06 PDT 2010


Author: lattner
Date: Mon Aug  9 19:34:06 2010
New Revision: 110636

URL: http://llvm.org/viewvc/llvm-project?rev=110636&view=rev
Log:
remove code setting rw locks to PTHREAD_PROCESS_PRIVATE, which
is the default.  Patch by NAKAMURA Takumi!

Modified:
    llvm/trunk/lib/System/RWMutex.cpp

Modified: llvm/trunk/lib/System/RWMutex.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/System/RWMutex.cpp?rev=110636&r1=110635&r2=110636&view=diff
==============================================================================
--- llvm/trunk/lib/System/RWMutex.cpp (original)
+++ llvm/trunk/lib/System/RWMutex.cpp Mon Aug  9 19:34:06 2010
@@ -71,23 +71,8 @@
     bzero(rwlock, sizeof(pthread_rwlock_t));
 #endif
 
-    pthread_rwlockattr_t attr;
-
-    // Initialize the rwlock attributes
-    int errorcode = pthread_rwlockattr_init(&attr);
-    assert(errorcode == 0);
-
-#if !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__NetBSD__) && !defined(__DragonFly__)
-    // Make it a process local rwlock
-    errorcode = pthread_rwlockattr_setpshared(&attr, PTHREAD_PROCESS_PRIVATE);
-#endif
-
     // Initialize the rwlock
-    errorcode = pthread_rwlock_init(rwlock, &attr);
-    assert(errorcode == 0);
-
-    // Destroy the attributes
-    errorcode = pthread_rwlockattr_destroy(&attr);
+    int errorcode = pthread_rwlock_init(rwlock, NULL);
     assert(errorcode == 0);
 
     // Assign the data member





More information about the llvm-commits mailing list