Remove unused framework::WriteGuard::getMode
...and consequently unused framework::ELockMode Change-Id: Icba47a9007e7250871be4bf5ee151504cad43f75
This commit is contained in:
parent
1997de8690
commit
803a8a04e9
@ -30,17 +30,6 @@ namespace osl { class Mutex; }
|
|||||||
|
|
||||||
namespace framework{
|
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
|
@short helper to set right lock in right situation
|
||||||
@descr This helper support different types of locking:
|
@descr This helper support different types of locking:
|
||||||
|
@ -60,7 +60,7 @@ class WriteGuard : private boost::noncopyable
|
|||||||
*//*-*****************************************************************************************************/
|
*//*-*****************************************************************************************************/
|
||||||
inline WriteGuard( LockHelper* pLock )
|
inline WriteGuard( LockHelper* pLock )
|
||||||
: m_pLock ( pLock )
|
: m_pLock ( pLock )
|
||||||
, m_eMode ( E_NOLOCK )
|
, m_locked(false)
|
||||||
{
|
{
|
||||||
lock();
|
lock();
|
||||||
}
|
}
|
||||||
@ -68,7 +68,7 @@ class WriteGuard : private boost::noncopyable
|
|||||||
|
|
||||||
inline WriteGuard( LockHelper& rLock )
|
inline WriteGuard( LockHelper& rLock )
|
||||||
: m_pLock ( &rLock )
|
: m_pLock ( &rLock )
|
||||||
, m_eMode ( E_NOLOCK )
|
, m_locked(false)
|
||||||
{
|
{
|
||||||
lock();
|
lock();
|
||||||
}
|
}
|
||||||
@ -102,11 +102,11 @@ class WriteGuard : private boost::noncopyable
|
|||||||
*//*-*****************************************************************************************************/
|
*//*-*****************************************************************************************************/
|
||||||
inline void lock()
|
inline void lock()
|
||||||
{
|
{
|
||||||
if ( m_eMode == E_NOLOCK ) {
|
if (!m_locked) {
|
||||||
// Acquire write access and set return state.
|
// Acquire write access and set return state.
|
||||||
// Mode is set later if it was successful!
|
// Mode is set later if it was successful!
|
||||||
m_pLock->acquire();
|
m_pLock->acquire();
|
||||||
m_eMode = E_WRITELOCK;
|
m_locked = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -124,29 +124,12 @@ class WriteGuard : private boost::noncopyable
|
|||||||
*//*-*****************************************************************************************************/
|
*//*-*****************************************************************************************************/
|
||||||
inline void unlock()
|
inline void unlock()
|
||||||
{
|
{
|
||||||
if ( m_eMode == E_WRITELOCK ) {
|
if (m_locked) {
|
||||||
m_pLock->release();
|
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 methods
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@ -171,7 +154,7 @@ class WriteGuard : private boost::noncopyable
|
|||||||
private:
|
private:
|
||||||
|
|
||||||
LockHelper* m_pLock ; /// reference to lock-member of protected object
|
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
|
}; // class WriteGuard
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user