wut  v1.7.0
Wii U Toolchain
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
17 extern "C" {
18 #endif
19 
20 typedef struct OSEvent OSEvent;
21 
22 typedef enum OSEventMode
23 {
26 
30 
31 #define OS_EVENT_TAG 0x65566E54u
32 
33 struct OSEvent
34 {
36  uint32_t tag;
37 
39  const char *name;
40 
41  WUT_UNKNOWN_BYTES(4);
42 
45 
48 
51 };
52 WUT_CHECK_OFFSET(OSEvent, 0x0, tag);
53 WUT_CHECK_OFFSET(OSEvent, 0x4, name);
54 WUT_CHECK_OFFSET(OSEvent, 0xc, value);
55 WUT_CHECK_OFFSET(OSEvent, 0x10, queue);
56 WUT_CHECK_OFFSET(OSEvent, 0x20, mode);
57 WUT_CHECK_SIZE(OSEvent, 0x24);
58 
59 
63 void
65  BOOL value,
66  OSEventMode mode);
67 
68 
72 void
74  BOOL value,
75  OSEventMode mode,
76  char *name);
77 
78 
92 void
94 
106 void
108 
109 
120 void
122 
123 
129 void
131 
132 
138 BOOL
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:41
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
Definition: event.h:34
int64_t OSTime
Definition: time.h:18
int32_t BOOL
Definition: wut_types.h:7