[Lldb-commits] [lldb] r187147 - Remove unused code
Ed Maste
emaste at freebsd.org
Thu Jul 25 12:02:57 PDT 2013
Author: emaste
Date: Thu Jul 25 14:02:57 2013
New Revision: 187147
URL: http://llvm.org/viewvc/llvm-project?rev=187147&view=rev
Log:
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
Modified:
lldb/trunk/include/lldb/Host/ReadWriteLock.h
Modified: lldb/trunk/include/lldb/Host/ReadWriteLock.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/ReadWriteLock.h?rev=187147&r1=187146&r2=187147&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Host/ReadWriteLock.h (original)
+++ lldb/trunk/include/lldb/Host/ReadWriteLock.h Thu Jul 25 14:02:57 2013
@@ -54,12 +54,6 @@ public:
}
bool
- ReadLock ()
- {
- return ::pthread_rwlock_rdlock (&m_rwlock) == 0;
- }
-
- bool
ReadTryLock ()
{
return ::pthread_rwlock_tryrdlock (&m_rwlock) == 0;
@@ -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);
More information about the lldb-commits
mailing list