wut v1.8.0
Wii U Toolchain
Loading...
Searching...
No Matches
event.h
Go to the documentation of this file.
1#pragma once
2#include <wut.h>
3#include "thread.h"
4#include "threadqueue.h"
5
16#ifdef __cplusplus
17extern "C" {
18#endif
19
20typedef struct OSEvent OSEvent;
21
30
31#define OS_EVENT_TAG 0x65566E54u
32
33struct OSEvent
34{
36 uint32_t tag;
37
39 const char *name;
40
41 WUT_UNKNOWN_BYTES(4);
42
45
48
51};
52WUT_CHECK_OFFSET(OSEvent, 0x0, tag);
53WUT_CHECK_OFFSET(OSEvent, 0x4, name);
54WUT_CHECK_OFFSET(OSEvent, 0xc, value);
55WUT_CHECK_OFFSET(OSEvent, 0x10, queue);
56WUT_CHECK_OFFSET(OSEvent, 0x20, mode);
57WUT_CHECK_SIZE(OSEvent, 0x24);
58
59
63void
65 BOOL value,
66 OSEventMode mode);
67
68
72void
74 BOOL value,
75 OSEventMode mode,
76 char *name);
77
78
92void
94
106void
108
109
120void
122
123
129void
131
132
138BOOL
140 OSTime timeout);
141
142#ifdef __cplusplus
143}
144#endif
145
OSEventMode mode
The mode of the event object, set by OSInitEvent.
Definition event.h:50
uint32_t tag
Should always be set to the value OS_EVENT_TAG.
Definition event.h:36
BOOL value
The current value of the event object.
Definition event.h:44
OSThreadQueue queue
The threads currently waiting on this event object with OSWaitEvent.
Definition event.h:47
const char * name
Name set by OSInitEventEx.
Definition event.h:39
void OSInitEventEx(OSEvent *event, BOOL value, OSEventMode mode, char *name)
Initialise an event object with value, mode and name.
void OSSignalEvent(OSEvent *event)
Signals the event.
void OSResetEvent(OSEvent *event)
Resets the event object.
OSEventMode
Definition event.h:23
void OSWaitEvent(OSEvent *event)
Wait until an event is signalled.
void OSInitEvent(OSEvent *event, BOOL value, OSEventMode mode)
Initialise an event object with value and mode.
void OSSignalEventAll(OSEvent *event)
Signals all threads waiting on an event.
BOOL OSWaitEventWithTimeout(OSEvent *event, OSTime timeout)
Wait until an event is signalled or a timeout has occurred.
@ OS_EVENT_MODE_MANUAL
A manual event will only reset when OSResetEvent is called.
Definition event.h:25
@ OS_EVENT_MODE_AUTO
An auto event will reset everytime a thread is woken.
Definition event.h:28
int64_t OSTime
Definition time.h:18
int32_t BOOL
Definition wut_types.h:7