wut  v1.7.0
Wii U Toolchain
condition.h
Go to the documentation of this file.
1 #pragma once
2 #include <wut.h>
3 #include "threadqueue.h"
4 
15 #ifdef __cplusplus
16 extern "C" {
17 #endif
18 
19 typedef struct OSCondition OSCondition;
20 typedef struct OSMutex OSMutex;
21 
22 #define OS_CONDITION_TAG 0x634E6456u
23 
25 {
27  uint32_t tag;
28 
30  const char *name;
31 
32  WUT_UNKNOWN_BYTES(4);
33 
36 };
37 WUT_CHECK_OFFSET(OSCondition, 0x00, tag);
38 WUT_CHECK_OFFSET(OSCondition, 0x04, name);
39 WUT_CHECK_OFFSET(OSCondition, 0x0c, queue);
40 WUT_CHECK_SIZE(OSCondition, 0x1c);
41 
42 
46 void
47 OSInitCond(OSCondition *condition);
48 
49 
53 void
55  const char *name);
56 
57 
66 void
68  OSMutex *mutex);
69 
70 
76 void
78 
79 
80 #ifdef __cplusplus
81 }
82 #endif
83 
uint32_t tag
Should always be set to the value OS_CONDITION_TAG.
Definition: condition.h:27
OSThreadQueue queue
Queue of threads currently waiting on condition with OSWaitCond.
Definition: condition.h:32
const char * name
Name set by OSInitCondEx.
Definition: condition.h:30
void OSInitCond(OSCondition *condition)
Initialise a condition variable structure.
void OSInitCondEx(OSCondition *condition, const char *name)
Initialise a condition variable structure with a name.
void OSSignalCond(OSCondition *condition)
Will wake up any threads waiting on the condition with OSWaitCond.
void OSWaitCond(OSCondition *condition, OSMutex *mutex)
Sleep the current thread until the condition variable has been signalled.
Definition: mutex.h:36