summaryrefslogtreecommitdiff
path: root/framework/inc
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2014-03-17 15:35:31 +0100
committerStephan Bergmann <sbergman@redhat.com>2014-03-17 16:52:34 +0100
commit803a8a04e980d24bf6c336e4416615a49614367f (patch)
tree47daaa15001de04c5126a08fdcefd1198a275bb3 /framework/inc
parent1997de8690e55d8a1cedd506db894b24d283e876 (diff)
Remove unused framework::WriteGuard::getMode
...and consequently unused framework::ELockMode Change-Id: Icba47a9007e7250871be4bf5ee151504cad43f75
Diffstat (limited to 'framework/inc')
-rw-r--r--framework/inc/threadhelp/lockhelper.hxx11
-rw-r--r--framework/inc/threadhelp/writeguard.hxx31
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
@@ -31,17 +31,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:
a) no locks - transparent for user!
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