WUT  0.1
Wii U Toolchain
Data Structures | Macros | Typedefs | Functions

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)
 
void OSInitMutexEx (OSMutex *mutex, const char *name)
 
void OSLockMutex (OSMutex *mutex)
 
BOOL OSTryLockMutex (OSMutex *mutex)
 
void OSUnlockMutex (OSMutex *mutex)
 

Detailed Description

Standard mutex object, supports recursive locking.

Similar to std::recursive_mutex.

Macro Definition Documentation

#define OS_MUTEX_TAG   0x6D557458u

Definition at line 33 of file mutex.h.

Typedef Documentation

typedef struct OSThread OSThread

Definition at line 19 of file mutex.h.

typedef struct OSMutex OSMutex

Definition at line 21 of file mutex.h.

typedef struct OSMutexLink OSMutexLink

Definition at line 22 of file mutex.h.

Function Documentation

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.

BOOL OSTryLockMutex ( OSMutex mutex)

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.

Returns
TRUE if the mutex is locked, FALSE if the mutex is owned by another thread.

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.