wut
v1.7.0
Wii U Toolchain
|
Standard mutex object, supports recursive locking. More...
Data Structures | |
struct | OSMutexLink |
struct | OSMutex |
Macros | |
#define | OS_MUTEX_TAG 0x6D557458u |
Typedefs | |
typedef struct OSThread | OSThread |
typedef struct OSMutex | OSMutex |
typedef struct OSMutexLink | OSMutexLink |
Functions | |
void | OSInitMutex (OSMutex *mutex) |
Initialise a mutex structure. More... | |
void | OSInitMutexEx (OSMutex *mutex, const char *name) |
Initialise a mutex structure with a name. More... | |
void | OSLockMutex (OSMutex *mutex) |
Lock the mutex. More... | |
BOOL | OSTryLockMutex (OSMutex *mutex) |
Try to lock a mutex. More... | |
void | OSUnlockMutex (OSMutex *mutex) |
Unlocks the mutex. More... | |
Standard mutex object, supports recursive locking.
Similar to std::recursive_mutex.
struct OSMutex |
Data Fields | ||
---|---|---|
uint32_t | tag | Should always be set to the value OS_MUTEX_TAG. |
const char * | name | Name set by OSInitMutexEx. |
OSThreadQueue | queue | Queue of threads waiting for this mutex to unlock. |
OSThread * | owner | Current owner of mutex. |
int32_t | count | Current recursion lock count of mutex. |
OSMutexLink | link | Link used inside OSThread's mutex queue. |
typedef struct OSMutexLink OSMutexLink |
void OSInitMutex | ( | OSMutex * | mutex | ) |
Initialise a mutex structure.
void OSInitMutexEx | ( | OSMutex * | mutex, |
const char * | name | ||
) |
Initialise a mutex structure with a name.
void OSLockMutex | ( | OSMutex * | mutex | ) |
Lock the mutex.
If no one owns the mutex, set current thread as owner.
If the lock is owned by the current thread, increase the recursion count.
If the lock is owned by another thread, the current thread will sleep until the owner has unlocked this mutex.
Similar to std::recursive_mutex::lock.
Try to lock a mutex.
If no one owns the mutex, set current thread as owner.
If the lock is owned by the current thread, increase the recursion count.
If the lock is owned by another thread, do not block, return FALSE.
Similar to std::recursive_mutex::try_lock.
void OSUnlockMutex | ( | OSMutex * | mutex | ) |
Unlocks the mutex.
Will decrease the recursion count, will only unlock the mutex when the recursion count reaches 0.
If any other threads are waiting to lock the mutex they will be woken.
Similar to std::recursive_mutex::unlock.