wut  v1.7.0
Wii U Toolchain
Data Structures | Macros | Typedefs | Enumerations | Functions
Event Object

Standard event object implementation. More...

Collaboration diagram for Event Object:

Data Structures

struct  OSEvent
 

Macros

#define OS_EVENT_TAG   0x65566E54u
 

Typedefs

typedef struct OSEvent OSEvent
 
typedef enum OSEventMode OSEventMode
 

Enumerations

enum  OSEventMode {
  OS_EVENT_MODE_MANUAL = 0 ,
  OS_EVENT_MODE_AUTO = 1
}
 

Functions

void OSInitEvent (OSEvent *event, BOOL value, OSEventMode mode)
 Initialise an event object with value and mode. More...
 
void OSInitEventEx (OSEvent *event, BOOL value, OSEventMode mode, char *name)
 Initialise an event object with value, mode and name. More...
 
void OSSignalEvent (OSEvent *event)
 Signals the event. More...
 
void OSSignalEventAll (OSEvent *event)
 Signals all threads waiting on an event. More...
 
void OSWaitEvent (OSEvent *event)
 Wait until an event is signalled. More...
 
void OSResetEvent (OSEvent *event)
 Resets the event object. More...
 
BOOL OSWaitEventWithTimeout (OSEvent *event, OSTime timeout)
 Wait until an event is signalled or a timeout has occurred. More...
 

Detailed Description

Standard event object implementation.

There are two supported event object modes, check OSEventMode.

Similar to Windows Event Objects.


Data Structure Documentation

◆ OSEvent

struct OSEvent

Definition at line 33 of file event.h.

Data Fields
uint32_t tag Should always be set to the value OS_EVENT_TAG.
const char * name Name set by OSInitEventEx.
BOOL value The current value of the event object.
OSThreadQueue queue The threads currently waiting on this event object with OSWaitEvent.
OSEventMode mode The mode of the event object, set by OSInitEvent.

Macro Definition Documentation

◆ OS_EVENT_TAG

#define OS_EVENT_TAG   0x65566E54u

Definition at line 31 of file event.h.

Typedef Documentation

◆ OSEvent

typedef struct OSEvent OSEvent

Definition at line 1 of file event.h.

◆ OSEventMode

typedef enum OSEventMode OSEventMode

Enumeration Type Documentation

◆ OSEventMode

Enumerator
OS_EVENT_MODE_MANUAL 

A manual event will only reset when OSResetEvent is called.

OS_EVENT_MODE_AUTO 

An auto event will reset everytime a thread is woken.

Definition at line 22 of file event.h.

Function Documentation

◆ OSInitEvent()

void OSInitEvent ( OSEvent event,
BOOL  value,
OSEventMode  mode 
)

Initialise an event object with value and mode.

◆ OSInitEventEx()

void OSInitEventEx ( OSEvent event,
BOOL  value,
OSEventMode  mode,
char *  name 
)

Initialise an event object with value, mode and name.

◆ OSSignalEvent()

void OSSignalEvent ( OSEvent event)

Signals the event.

If no threads are waiting the event value is set.

If the event mode is OS_EVENT_MODE_MANUAL this will wake all waiting threads and the event will remain set until OSResetEvent is called.

If the event mode is OS_EVENT_MODE_AUTO this will wake only one thread and the event will be reset immediately.

Similar to SetEvent.

◆ OSSignalEventAll()

void OSSignalEventAll ( OSEvent event)

Signals all threads waiting on an event.

If no threads are waiting the event value is set.

If the event mode is OS_EVENT_MODE_MANUAL this will wake all waiting threads and the event will remain set until OSResetEvent is called.

If the event mode is OS_EVENT_MODE_AUTO this will wake all waiting threads and the event will be reset.

◆ OSWaitEvent()

void OSWaitEvent ( OSEvent event)

Wait until an event is signalled.

If the event is already set, this returns immediately.

If the event mode is OS_EVENT_MODE_AUTO the event will be reset before returning from this method.

Similar to WaitForSingleObject.

◆ OSResetEvent()

void OSResetEvent ( OSEvent event)

Resets the event object.

Similar to ResetEvent.

◆ OSWaitEventWithTimeout()

BOOL OSWaitEventWithTimeout ( OSEvent event,
OSTime  timeout 
)

Wait until an event is signalled or a timeout has occurred.

Similar to WaitForSingleObject.