From 803a8a04e980d24bf6c336e4416615a49614367f Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Mon, 17 Mar 2014 15:35:31 +0100 Subject: [PATCH] Remove unused framework::WriteGuard::getMode ...and consequently unused framework::ELockMode Change-Id: Icba47a9007e7250871be4bf5ee151504cad43f75 --- framework/inc/threadhelp/lockhelper.hxx | 11 --------- framework/inc/threadhelp/writeguard.hxx | 31 ++++++------------------- 2 files changed, 7 insertions(+), 35 deletions(-) diff --git a/framework/inc/threadhelp/lockhelper.hxx b/framework/inc/threadhelp/lockhelper.hxx index 1cf176fcfda8..c64fc45afb9f 100644 --- a/framework/inc/threadhelp/lockhelper.hxx +++ b/framework/inc/threadhelp/lockhelper.hxx @@ -30,17 +30,6 @@ namespace osl { class Mutex; } namespace framework{ -/*-************************************************************************************************************ - @descr A guard (specialy a write guard) support different internal working states. - His lock can set for reading or writing/reading! Or he was unlocked by user ... -*//*-*************************************************************************************************************/ -enum ELockMode -{ - E_NOLOCK , - E_READLOCK , - E_WRITELOCK -}; - /*-************************************************************************************************************ @short helper to set right lock in right situation @descr This helper support different types of locking: diff --git a/framework/inc/threadhelp/writeguard.hxx b/framework/inc/threadhelp/writeguard.hxx index f438b2a9d255..516ea926d9f3 100644 --- a/framework/inc/threadhelp/writeguard.hxx +++ b/framework/inc/threadhelp/writeguard.hxx @@ -60,7 +60,7 @@ class WriteGuard : private boost::noncopyable *//*-*****************************************************************************************************/ inline WriteGuard( LockHelper* pLock ) : m_pLock ( pLock ) - , m_eMode ( E_NOLOCK ) + , m_locked(false) { lock(); } @@ -68,7 +68,7 @@ class WriteGuard : private boost::noncopyable inline WriteGuard( LockHelper& rLock ) : m_pLock ( &rLock ) - , m_eMode ( E_NOLOCK ) + , m_locked(false) { lock(); } @@ -102,11 +102,11 @@ class WriteGuard : private boost::noncopyable *//*-*****************************************************************************************************/ inline void lock() { - if ( m_eMode == E_NOLOCK ) { + if (!m_locked) { // Acquire write access and set return state. // Mode is set later if it was successful! m_pLock->acquire(); - m_eMode = E_WRITELOCK; + m_locked = true; } } @@ -124,29 +124,12 @@ class WriteGuard : private boost::noncopyable *//*-*****************************************************************************************************/ inline void unlock() { - if ( m_eMode == E_WRITELOCK ) { + if (m_locked) { m_pLock->release(); - m_eMode = E_NOLOCK; + m_locked = false; } } - /*-**************************************************************************************************** - @short return internal states - @descr For user they dont know what they are doing ... - - @seealso - - - @param - - @return Current set lock mode. - - @onerror No error should occur. - *//*-*****************************************************************************************************/ - inline ELockMode getMode() const - { - return m_eMode; - } - - // private methods private: @@ -171,7 +154,7 @@ class WriteGuard : private boost::noncopyable private: LockHelper* m_pLock ; /// reference to lock-member of protected object - ELockMode m_eMode ; /// protection against multiple lock calls without unlock and difference between supported lock modi + bool m_locked; }; // class WriteGuard