Remove unused code

- ReadLocker constructors that take a lock
- Unconditional Lock::ReadLock and ReadLocker::Lock
  (all consumers use TryLock)
- Make Unlock protected, as it has no external consumers

llvm-svn: 187147
This commit is contained in:
Ed Maste 2013-07-25 19:02:57 +00:00
parent 060f70b243
commit e4dd89f020
1 changed files with 1 additions and 37 deletions

View File

@ -53,12 +53,6 @@ public:
//#endif
}
bool
ReadLock ()
{
return ::pthread_rwlock_rdlock (&m_rwlock) == 0;
}
bool
ReadTryLock ()
{
@ -97,41 +91,11 @@ public:
{
}
ReadLocker (ReadWriteLock &lock) :
m_lock (NULL)
{
Lock(&lock);
}
ReadLocker (ReadWriteLock *lock) :
m_lock (NULL)
{
Lock(lock);
}
~ReadLocker()
{
Unlock();
}
void
Lock (ReadWriteLock *lock)
{
if (m_lock)
{
if (m_lock == lock)
return; // We already have this lock locked
else
Unlock();
}
if (lock)
{
lock->ReadLock();
m_lock = lock;
}
}
// Try to lock the read lock, but only do so if there are no writers.
bool
TryLock (ReadWriteLock *lock)
@ -154,6 +118,7 @@ public:
return false;
}
protected:
void
Unlock ()
{
@ -164,7 +129,6 @@ public:
}
}
protected:
ReadWriteLock *m_lock;
private:
DISALLOW_COPY_AND_ASSIGN(ReadLocker);