libOGC  1.0
 All Data Structures Files Functions Variables Typedefs Macros Modules Pages
Macros | Typedefs | Functions
mutex.h File Reference

Thread subsystem III. More...

#include <gctypes.h>

Macros

#define LWP_MUTEX_NULL   0xffffffff
 

Typedefs

typedef u32 mutex_t
 typedef for the mutex handle
 

Functions

s32 LWP_MutexDestroy (mutex_t mutex)
 Close mutex lock, release all threads and handles locked on this mutex. More...
 
s32 LWP_MutexInit (mutex_t *mutex, bool use_recursive)
 Initializes a mutex lock. More...
 
s32 LWP_MutexLock (mutex_t mutex)
 Enter the mutex lock. More...
 
s32 LWP_MutexTryLock (mutex_t mutex)
 Try to enter the mutex lock. More...
 
s32 LWP_MutexUnlock (mutex_t mutex)
 Release the mutex lock and let other threads process further on this mutex. More...
 

Detailed Description

Thread subsystem III.

Function Documentation

s32 LWP_MutexDestroy ( mutex_t  mutex)

Close mutex lock, release all threads and handles locked on this mutex.

Parameters
[in]mutexhandle to the mutex_t structure.
Returns
0 on success, <0 on error
s32 LWP_MutexInit ( mutex_t mutex,
bool  use_recursive 
)

Initializes a mutex lock.

Parameters
[out]mutexpointer to a mutex_t handle.
[in]use_recursivewhether to allow the thread, whithin the same context, to enter multiple times the lock or not.
Returns
0 on success, <0 on error
s32 LWP_MutexLock ( mutex_t  mutex)

Enter the mutex lock.

Parameters
[in]mutexhandle to the mutext_t structure.
Returns
0 on success, <0 on error
s32 LWP_MutexTryLock ( mutex_t  mutex)

Try to enter the mutex lock.

Parameters
[in]mutexhandle to the mutex_t structure.
Returns
0: on first aquire, 1: would lock
s32 LWP_MutexUnlock ( mutex_t  mutex)

Release the mutex lock and let other threads process further on this mutex.

Parameters
[in]mutexhandle to the mutex_t structure.
Returns
0 on success, <0 on error