forked from OSchip/llvm-project
Workaround for an... interesting bug in Darwin's pthread_rwlock_init.
llvm-svn: 73806
This commit is contained in:
parent
90d612e536
commit
96c51a8de1
|
|
@ -13,6 +13,7 @@
|
||||||
|
|
||||||
#include "llvm/Config/config.h"
|
#include "llvm/Config/config.h"
|
||||||
#include "llvm/System/RWMutex.h"
|
#include "llvm/System/RWMutex.h"
|
||||||
|
#include <cstring>
|
||||||
|
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
//=== WARNING: Implementation here must contain only TRULY operating system
|
//=== WARNING: Implementation here must contain only TRULY operating system
|
||||||
|
|
@ -64,6 +65,12 @@ RWMutexImpl::RWMutexImpl()
|
||||||
// Declare the pthread_rwlock data structures
|
// Declare the pthread_rwlock data structures
|
||||||
pthread_rwlock_t* rwlock =
|
pthread_rwlock_t* rwlock =
|
||||||
static_cast<pthread_rwlock_t*>(malloc(sizeof(pthread_rwlock_t)));
|
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;
|
pthread_rwlockattr_t attr;
|
||||||
|
|
||||||
// Initialize the rwlock attributes
|
// Initialize the rwlock attributes
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue