mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-16 14:31:59 +00:00
Update the non-pthreads fallback for RWMutex on Unix
Tested this by #if 0'ing out the pthreads implementation, which indicated that this fallback was not currently compiling successfully and applying this patch resolves that. Patch by Andy Chien. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220969 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
07c3753e14
commit
c700c4d161
@ -26,26 +26,26 @@ using namespace sys;
|
|||||||
// will therefore deadlock if a thread tries to acquire a read lock
|
// will therefore deadlock if a thread tries to acquire a read lock
|
||||||
// multiple times.
|
// multiple times.
|
||||||
|
|
||||||
RWMutexImpl::RWMutexImpl() : data_(new Mutex(false)) { }
|
RWMutexImpl::RWMutexImpl() : data_(new MutexImpl(false)) { }
|
||||||
|
|
||||||
RWMutexImpl::~RWMutexImpl() {
|
RWMutexImpl::~RWMutexImpl() {
|
||||||
delete static_cast<Mutex *>(data_);
|
delete static_cast<MutexImpl *>(data_);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool RWMutexImpl::reader_acquire() {
|
bool RWMutexImpl::reader_acquire() {
|
||||||
return static_cast<Mutex *>(data_)->acquire();
|
return static_cast<MutexImpl *>(data_)->acquire();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool RWMutexImpl::reader_release() {
|
bool RWMutexImpl::reader_release() {
|
||||||
return static_cast<Mutex *>(data_)->release();
|
return static_cast<MutexImpl *>(data_)->release();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool RWMutexImpl::writer_acquire() {
|
bool RWMutexImpl::writer_acquire() {
|
||||||
return static_cast<Mutex *>(data_)->acquire();
|
return static_cast<MutexImpl *>(data_)->acquire();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool RWMutexImpl::writer_release() {
|
bool RWMutexImpl::writer_release() {
|
||||||
return static_cast<Mutex *>(data_)->release();
|
return static_cast<MutexImpl *>(data_)->release();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user