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

Thread subsystem IV. More...

#include <gctypes.h>

Macros

#define LWP_SEM_NULL   0xffffffff
 

Typedefs

typedef u32 sem_t
 typedef for the semaphore handle
 

Functions

s32 LWP_SemDestroy (sem_t sem)
 Close and destroy a semaphore, release all threads and handles locked on this semaphore. More...
 
s32 LWP_SemInit (sem_t *sem, u32 start, u32 max)
 Initializes a semaphore. More...
 
s32 LWP_SemPost (sem_t sem)
 Count up semaphore counter and release lock if counter >0. More...
 
s32 LWP_SemWait (sem_t sem)
 Count down semaphore counter and enter lock if counter <=0. More...
 

Detailed Description

Thread subsystem IV.

Function Documentation

s32 LWP_SemDestroy ( sem_t  sem)

Close and destroy a semaphore, release all threads and handles locked on this semaphore.

Parameters
[in]semhandle to the sem_t structure.
Returns
0 on success, <0 on error
s32 LWP_SemInit ( sem_t sem,
u32  start,
u32  max 
)

Initializes a semaphore.

Parameters
[out]sempointer to a sem_t handle.
[in]startstart count of the semaphore
[in]maxmaximum count of the semaphore
Returns
0 on success, <0 on error
s32 LWP_SemPost ( sem_t  sem)

Count up semaphore counter and release lock if counter >0.

Parameters
[in]semhandle to the sem_t structure.
Returns
0 on success, <0 on error
s32 LWP_SemWait ( sem_t  sem)

Count down semaphore counter and enter lock if counter <=0.

Parameters
[in]semhandle to the sem_t structure.
Returns
0 on success, <0 on error