28#if !defined( INC_CINOSMUTEX_H )
29#define INC_CINOSMUTEX_H
44 eFlgNone = 0x00000000,
46 eFlgClassic = 0x00000001,
48 eFlgReclaimLock = 0x00000002,
129 {
return m_Lock.GetAddr(); };
#define DECLARE_DYNAMIC_PLACEMENT(aClass)
Definition cinospartitionmemory.h:348
#define DECLARE_DYNAMIC(aClass)
Definition cinospartitionmemory.h:328
Definition cinosmutex.h:167
~CINOSLock()
Release the owned mutex.
Definition cinosmutex.h:180
CINOSMutex * m_pMutex
pointer to the owned mutex
Definition cinosmutex.h:194
CINOSLock(CINOSMutex &aMutex)
Request the given mutex. See also Critical sections.
Definition cinosmutex.h:175
void EarlyUnlock()
Release the owned mutex. Can be used to release the mutex before the destructor is called.
Definition cinosmutex.h:186
Definition cinosmcmodule.h:1900
Definition cinosmutex.h:36
ICACHE class CINOSTask * GetOwner()
Return id of mutex owner.
Definition cinosmutex.h:118
ICACHE void Release(bool aSuspend=false, uint32 auState=defINOSTaskPureSuspended)
ICACHE void unlock()
Definition cinosmutex.h:112
tTaskId m_idFstWaiting
id of first task waiting for the mutex
Definition cinosmutex.h:148
uint32 m_uFlags
mutex flags
Definition cinosmutex.h:152
tTaskId m_idOwner
owner of mutex (0->free)
Definition cinosmutex.h:147
SINOSCoreLock m_Lock
core lock
Definition cinosmutex.h:151
const char * m_pName
name of mutex
Definition cinosmutex.h:146
~CINOSMutex()
Destroy mutex. It is not allowed to destroy a mutex with still waiting tasks. This ends up in an asse...
ICACHE uint32 Request(uint32 aTimeout=INOS_WAIT_FOREVER)
const char * GetName()
Return mutex name.
Definition cinosmutex.h:123
CINOSMutex(const char *apName=0, EFlags aeFlags=eFlgNone)
Create a mutex with the given name.
ICACHE void lock()
Definition cinosmutex.h:80
void SetFlag(EFlags aeFlag)
sets the given mutex flag.
bool try_lock()
Definition cinosmutex.h:97
uint32 m_uCounter
number of times the owner 'owns' the mutex
Definition cinosmutex.h:150
void ClrFlag(EFlags aeFlag)
clears the given mutex flag.
CINOSMutex(EFlags aeFlags)
Create a mutex with the given name.
tTaskId m_idLstWaiting
id of last task waiting for the mutex
Definition cinosmutex.h:149
volatile uint32 * GetLockAdr()
Return pointer to core locking structure.
Definition cinosmutex.h:128
Definition cinostask.h:52
Definition cinosmutex.h:198
void EarlyUnlock()
Release the owned mutex. Can be used to release the mutex before the destructor is called....
Definition cinosmutex.h:225
CINOSTryLock(CINOSMutex &aMutex)
Try to request the given mutex. IOW: Locks if mutex is not held by another task, but does nothing oth...
Definition cinosmutex.h:209
CINOSMutex * m_pMutex
pointer to the owned mutex
Definition cinosmutex.h:245
~CINOSTryLock()
Release the owned mutex.
Definition cinosmutex.h:216
Definition inostype.h:258
Definition inostype.h:192