wut
v1.7.0
Wii U Toolchain
|
Similar to Windows Semaphore Objects. More...
Data Structures | |
struct | OSSemaphore |
Macros | |
#define | OS_SEMAPHORE_TAG 0x73506852u |
Typedefs | |
typedef struct OSSemaphore | OSSemaphore |
Functions | |
void | OSInitSemaphore (OSSemaphore *semaphore, int32_t count) |
Initialise semaphore object with count. More... | |
void | OSInitSemaphoreEx (OSSemaphore *semaphore, int32_t count, const char *name) |
Initialise semaphore object with count and name. More... | |
int32_t | OSGetSemaphoreCount (OSSemaphore *semaphore) |
Get the current semaphore count. More... | |
int32_t | OSSignalSemaphore (OSSemaphore *semaphore) |
Increase the semaphore value. More... | |
int32_t | OSWaitSemaphore (OSSemaphore *semaphore) |
Decrease the semaphore value. More... | |
int32_t | OSTryWaitSemaphore (OSSemaphore *semaphore) |
Try to decrease the semaphore value. More... | |
Similar to Windows Semaphore Objects.
struct OSSemaphore |
Definition at line 21 of file semaphore.h.
Data Fields | ||
---|---|---|
uint32_t | tag | Should always be set to the value OS_SEMAPHORE_TAG. |
const char * | name | Name set by OSInitMutexEx. |
int32_t | count | Current count of semaphore. |
OSThreadQueue | queue | Queue of threads waiting on semaphore object with OSWaitSemaphore. |
#define OS_SEMAPHORE_TAG 0x73506852u |
Definition at line 19 of file semaphore.h.
typedef struct OSSemaphore OSSemaphore |
Definition at line 1 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.