RunLocker was not used anywhere, and was the only instance of the
WriteLocker class. Remove both.
llvm-svn: 186361
DISALLOW_COPY_AND_ASSIGN(ReadLocker);
};
- class WriteLocker
- {
- public:
- WriteLocker () :
- m_lock (NULL)
- {
- }
-
- WriteLocker (ReadWriteLock &lock) :
- m_lock (NULL)
- {
- Lock(&lock);
- }
-
- WriteLocker (ReadWriteLock *lock) :
- m_lock (NULL)
- {
- Lock(lock);
- }
-
- ~WriteLocker()
- {
- Unlock();
- }
-
- void
- Lock (ReadWriteLock *lock)
- {
- if (m_lock)
- {
- if (m_lock == lock)
- return; // We already have this lock locked
- else
- Unlock();
- }
- if (lock)
- {
- lock->WriteLock();
- m_lock = lock;
- }
- }
-
- void
- Unlock ()
- {
- if (m_lock)
- {
- m_lock->WriteUnlock();
- m_lock = NULL;
- }
- }
-
- protected:
- ReadWriteLock *m_lock;
- private:
- DISALLOW_COPY_AND_ASSIGN(WriteLocker);
- };
-
protected:
pthread_rwlock_t m_rwlock;
private:
// try to lock it to see if they can immediately access the stopped
// process. If the try read lock fails, then the process is running.
typedef ReadWriteLock::ReadLocker StopLocker;
- typedef ReadWriteLock::WriteLocker RunLocker;
// These two functions fill out the Broadcaster interface: