WUT
0.1
Wii U Toolchain
|
Data Structures | |
struct | OSSemaphore |
Macros | |
#define | OS_SEMAPHORE_TAG 0x73506852u |
Typedefs | |
typedef struct OSSemaphore | OSSemaphore |
Functions | |
void | OSInitSemaphore (OSSemaphore *semaphore, int32_t count) |
void | OSInitSemaphoreEx (OSSemaphore *semaphore, int32_t count, const char *name) |
int32_t | OSGetSemaphoreCount (OSSemaphore *semaphore) |
int32_t | OSSignalSemaphore (OSSemaphore *semaphore) |
int32_t | OSWaitSemaphore (OSSemaphore *semaphore) |
int32_t | OSTryWaitSemaphore (OSSemaphore *semaphore) |
Similar to Windows Semaphore Objects.
#define OS_SEMAPHORE_TAG 0x73506852u |
Definition at line 19 of file semaphore.h.
typedef struct OSSemaphore OSSemaphore |
Definition at line 17 of file semaphore.h.
void OSInitSemaphore | ( | OSSemaphore * | semaphore, |
int32_t | count | ||
) |
Initialise semaphore object with count.
void OSInitSemaphoreEx | ( | OSSemaphore * | semaphore, |
int32_t | count, | ||
const char * | name | ||
) |
Initialise semaphore object with count and name.
int32_t OSGetSemaphoreCount | ( | OSSemaphore * | semaphore | ) |
Get the current semaphore count.
int32_t OSSignalSemaphore | ( | OSSemaphore * | semaphore | ) |
Increase the semaphore value.
If any threads are waiting for semaphore, they are woken.
int32_t OSWaitSemaphore | ( | OSSemaphore * | semaphore | ) |
Decrease the semaphore value.
If the value is less than or equal to zero the current thread will be put to sleep until the count is above zero and it can decrement it safely.
int32_t OSTryWaitSemaphore | ( | OSSemaphore * | semaphore | ) |
Try to decrease the semaphore value.
If the value is greater than zero then it will be decremented, else the function will return immediately with a value <= 0 indicating a failure.