24#ifndef INCLUDED_OSL_MUTEX_HXX
25#define INCLUDED_OSL_MUTEX_HXX
99 friend oslMutex* SAL_CALL ::osl_getGlobalMutex();
197#ifdef LIBO_INTERNAL_ONLY
217 class ResettableGuard :
public ClearableGuard< T >
229 ClearableGuard<T>( pT_ ),
236 ClearableGuard<T>( rT ),
244#ifdef LIBO_INTERNAL_ONLY
255#ifdef LIBO_INTERNAL_ONLY
257 template<
class ResettableGuard_t>
258 class ResettableGuardScopedReleaser
261 ResettableGuardScopedReleaser(ResettableGuard_t& r)
262 : m_rResettableGuard(r)
264 m_rResettableGuard.clear();
266 ~ResettableGuardScopedReleaser() { m_rResettableGuard.reset(); }
269 ResettableGuard_t& m_rResettableGuard;
276#ifdef LIBO_INTERNAL_ONLY
277 typedef ResettableGuardScopedReleaser<ResettableMutexGuard> ResettableMutexGuardScopedReleaser;
#define SAL_DELETED_FUNCTION
short-circuit extra-verbose API namespaces
Definition types.h:396
#define SAL_WARN_UNUSED
Annotate classes where a compiler should warn if an instance is unused.
Definition types.h:611
SAL_DLLPUBLIC sal_Bool osl_acquireMutex(oslMutex Mutex)
Acquire the mutex, block if already acquired by another thread.
SAL_DLLPUBLIC void osl_destroyMutex(oslMutex Mutex)
Release the OS-structures and free mutex data-structure.
SAL_DLLPUBLIC oslMutex * osl_getGlobalMutex(void)
Returns a unique and global mutex.
SAL_DLLPUBLIC sal_Bool osl_releaseMutex(oslMutex Mutex)
Release the mutex.
struct _oslMutexImpl * oslMutex
Definition mutex.h:37
SAL_DLLPUBLIC sal_Bool osl_tryToAcquireMutex(oslMutex Mutex)
Try to acquire the mutex without blocking.
SAL_DLLPUBLIC oslMutex osl_createMutex(void)
Create a mutex.
Definition condition.hxx:31
ClearableGuard< Mutex > ClearableMutexGuard
Definition mutex.hxx:274
Guard< Mutex > MutexGuard
Definition mutex.hxx:273
ResettableGuard< Mutex > ResettableMutexGuard
Definition mutex.hxx:275
static Mutex * getGlobalMutex()
Returns a global static mutex object.
Definition mutex.hxx:90
bool acquire()
Acquire the mutex, block if already acquired by another thread.
Definition mutex.hxx:61
~Mutex()
Release the OS-structures and free mutex data-structure.
Definition mutex.hxx:52
Mutex()
Create a mutex.
Definition mutex.hxx:44
bool release()
Release the mutex.
Definition mutex.hxx:79
bool tryToAcquire()
Try to acquire the mutex without blocking.
Definition mutex.hxx:70
Object lifetime scoped mutex object or interface lock.
Definition mutex.hxx:124
Guard(T &t)
Acquires the object specified as parameter.
Definition mutex.hxx:142
Mutex * pT
Definition mutex.hxx:129
~Guard()
Releases the mutex or interface.
Definition mutex.hxx:148
Guard(T *pT_)
Acquires the object specified as parameter.
Definition mutex.hxx:134
Object lifetime scoped mutex object or interface lock with unlock.
Definition mutex.hxx:162
~ClearableGuard()
Releases the mutex or interface if not already released by clear().
Definition mutex.hxx:187
void clear()
Releases the mutex or interface.
Definition mutex.hxx:195
ClearableGuard(T &t)
Acquires the object specified as parameter.
Definition mutex.hxx:180
Mutex * pT
Definition mutex.hxx:167
ClearableGuard(T *pT_)
Acquires the object specified as parameter.
Definition mutex.hxx:172
ResettableGuard(T &rT)
Acquires the object specified as parameter.
Definition mutex.hxx:235
void reset()
Re-acquires the mutex or interface.
Definition mutex.hxx:242
Mutex * pResetT
Definition mutex.hxx:223
ResettableGuard(T *pT_)
Acquires the object specified as parameter.
Definition mutex.hxx:228