summaryrefslogtreecommitdiffstats
path: root/llvm/lib/System
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2009-06-18 18:26:15 +0000
committerOwen Anderson <resistor@mac.com>2009-06-18 18:26:15 +0000
commit1498a7a5104e4c1291ec5500ee5c3e68394cda5e (patch)
tree316f6e554bc3de280a8cee360f9252d19c290a02 /llvm/lib/System
parent68f6598c69a75d8833945070d180730154cd3b6d (diff)
downloadbcm5719-llvm-1498a7a5104e4c1291ec5500ee5c3e68394cda5e.tar.gz
bcm5719-llvm-1498a7a5104e4c1291ec5500ee5c3e68394cda5e.zip
Give RWMutex the SmartRWMutex treatment too.
llvm-svn: 73710
Diffstat (limited to 'llvm/lib/System')
-rw-r--r--llvm/lib/System/RWMutex.cpp24
-rw-r--r--llvm/lib/System/Unix/RWMutex.inc12
-rw-r--r--llvm/lib/System/Win32/RWMutex.inc12
3 files changed, 24 insertions, 24 deletions
diff --git a/llvm/lib/System/RWMutex.cpp b/llvm/lib/System/RWMutex.cpp
index 2b6cf6c2148..cf1aea03ddf 100644
--- a/llvm/lib/System/RWMutex.cpp
+++ b/llvm/lib/System/RWMutex.cpp
@@ -23,12 +23,12 @@
// Define all methods as no-ops if threading is explicitly disabled
namespace llvm {
using namespace sys;
-RWMutex::RWMutex() { }
-RWMutex::~RWMutex() { }
-bool RWMutex::reader_acquire() { return true; }
-bool RWMutex::reader_release() { return true; }
-bool RWMutex::writer_acquire() { return true; }
-bool RWMutex::writer_release() { return true; }
+RWMutexImpl::RWMutexImpl() { }
+RWMutexImpl::~RWMutexImpl() { }
+bool RWMutexImpl::reader_acquire() { return true; }
+bool RWMutexImpl::reader_release() { return true; }
+bool RWMutexImpl::writer_acquire() { return true; }
+bool RWMutexImpl::writer_release() { return true; }
}
#else
@@ -56,7 +56,7 @@ using namespace sys;
static const bool pthread_enabled = true;
// Construct a RWMutex using pthread calls
-RWMutex::RWMutex()
+RWMutexImpl::RWMutexImpl()
: data_(0)
{
if (pthread_enabled)
@@ -89,7 +89,7 @@ RWMutex::RWMutex()
}
// Destruct a RWMutex
-RWMutex::~RWMutex()
+RWMutexImpl::~RWMutexImpl()
{
if (pthread_enabled)
{
@@ -101,7 +101,7 @@ RWMutex::~RWMutex()
}
bool
-RWMutex::reader_acquire()
+RWMutexImpl::reader_acquire()
{
if (pthread_enabled)
{
@@ -115,7 +115,7 @@ RWMutex::reader_acquire()
}
bool
-RWMutex::reader_release()
+RWMutexImpl::reader_release()
{
if (pthread_enabled)
{
@@ -129,7 +129,7 @@ RWMutex::reader_release()
}
bool
-RWMutex::writer_acquire()
+RWMutexImpl::writer_acquire()
{
if (pthread_enabled)
{
@@ -143,7 +143,7 @@ RWMutex::writer_acquire()
}
bool
-RWMutex::writer_release()
+RWMutexImpl::writer_release()
{
if (pthread_enabled)
{
diff --git a/llvm/lib/System/Unix/RWMutex.inc b/llvm/lib/System/Unix/RWMutex.inc
index 4487d7f83da..e83d41ef4cf 100644
--- a/llvm/lib/System/Unix/RWMutex.inc
+++ b/llvm/lib/System/Unix/RWMutex.inc
@@ -20,23 +20,23 @@ namespace llvm {
using namespace sys;
-RWMutex::RWMutex() { }
+RWMutexImpl::RWMutexImpl() { }
-RWMutex::~RWMutex() { }
+RWMutexImpl::~RWMutexImpl() { }
-bool RWMutex::reader_acquire() {
+bool RWMutexImpl::reader_acquire() {
return true;
}
-bool RWMutex::reader_release() {
+bool RWMutexImpl::reader_release() {
return true;
}
-bool RWMutex::writer_acquire() {
+bool RWMutexImpl::writer_acquire() {
return true;
}
-bool RWMutex::writer_release() {
+bool RWMutexImpl::writer_release() {
return true;
}
diff --git a/llvm/lib/System/Win32/RWMutex.inc b/llvm/lib/System/Win32/RWMutex.inc
index 7fc4b33b1e9..e2692269e3a 100644
--- a/llvm/lib/System/Win32/RWMutex.inc
+++ b/llvm/lib/System/Win32/RWMutex.inc
@@ -24,32 +24,32 @@
namespace llvm {
using namespace sys;
-RWMutex::RWMutex() {
+RWMutexImpl::RWMutexImpl() {
data_ = calloc(1, sizeof(CRITICAL_SECTION));
InitializeCriticalSection(static_cast<LPCRITICAL_SECTION>(data_));
}
-RWMutex::~RWMutex() {
+RWMutexImpl::~RWMutexImpl() {
DeleteCriticalSection(static_cast<LPCRITICAL_SECTION>(data_));
free(data_);
}
-bool RWMutex::reader_acquire() {
+bool RWMutexImpl::reader_acquire() {
EnterCriticalSection(static_cast<LPCRITICAL_SECTION>(data_));
return true;
}
-bool RWMutex::reader_release() {
+bool RWMutexImpl::reader_release() {
LeaveCriticalSection(static_cast<LPCRITICAL_SECTION>(data_));
return true;
}
-bool RWMutex::writer_acquire() {
+bool RWMutexImpl::writer_acquire() {
EnterCriticalSection(static_cast<LPCRITICAL_SECTION>(data_));
return true;
}
-bool RWMutex::writer_release() {
+bool RWMutexImpl::writer_release() {
LeaveCriticalSection(static_cast<LPCRITICAL_SECTION>(data_));
return true;
}
OpenPOWER on IntegriCloud