wut v1.8.0
Wii U Toolchain
Loading...
Searching...
No Matches
condition.h
Go to the documentation of this file.
1#pragma once
2#include <wut.h>
3#include "threadqueue.h"
4
15#ifdef __cplusplus
16extern "C" {
17#endif
18
19typedef struct OSCondition OSCondition;
20typedef 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};
37WUT_CHECK_OFFSET(OSCondition, 0x00, tag);
38WUT_CHECK_OFFSET(OSCondition, 0x04, name);
39WUT_CHECK_OFFSET(OSCondition, 0x0c, queue);
40WUT_CHECK_SIZE(OSCondition, 0x1c);
41
42
46void
48
49
53void
55 const char *name);
56
57
66void
68 OSMutex *mutex);
69
70
76void
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:35
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.