diff options
| author | Owen Anderson <resistor@mac.com> | 2009-06-20 00:32:27 +0000 |
|---|---|---|
| committer | Owen Anderson <resistor@mac.com> | 2009-06-20 00:32:27 +0000 |
| commit | 96c51a8de18ee0675f48a98649fe25175c6b36f8 (patch) | |
| tree | 28d93ec58747c49dda536ad7f5ed2a6ff2001783 /llvm/lib/System | |
| parent | 90d612e536ea5a4dea4a94bd3cad1ed3433102dc (diff) | |
| download | bcm5719-llvm-96c51a8de18ee0675f48a98649fe25175c6b36f8.tar.gz bcm5719-llvm-96c51a8de18ee0675f48a98649fe25175c6b36f8.zip | |
Workaround for an... interesting bug in Darwin's pthread_rwlock_init.
llvm-svn: 73806
Diffstat (limited to 'llvm/lib/System')
| -rw-r--r-- | llvm/lib/System/RWMutex.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/System/RWMutex.cpp b/llvm/lib/System/RWMutex.cpp index cf1aea03ddf..15d98cb8f41 100644 --- a/llvm/lib/System/RWMutex.cpp +++ b/llvm/lib/System/RWMutex.cpp @@ -13,6 +13,7 @@ #include "llvm/Config/config.h" #include "llvm/System/RWMutex.h" +#include <cstring> //===----------------------------------------------------------------------===// //=== WARNING: Implementation here must contain only TRULY operating system @@ -64,6 +65,12 @@ RWMutexImpl::RWMutexImpl() // Declare the pthread_rwlock data structures pthread_rwlock_t* rwlock = static_cast<pthread_rwlock_t*>(malloc(sizeof(pthread_rwlock_t))); + +#ifdef __APPLE__ + // Workaround a bug/mis-feature in Darwin's pthread_rwlock_init. + bzero(rwlock, sizeof(pthread_rwlock_t)); +#endif + pthread_rwlockattr_t attr; // Initialize the rwlock attributes |

