libnx  v4.6.0
Data Structures | Functions
event.h File Reference

Kernel-mode event synchronization primitive. More...

#include "../types.h"
#include "../result.h"
#include "wait.h"

Go to the source code of this file.

Data Structures

struct  Event
 Kernel-mode event structure. More...
 

Functions

static Waiter waiterForEvent (Event *t)
 Creates a Waiter for a kernel-mode event.
 
Result eventCreate (Event *t, bool autoclear)
 Creates a kernel-mode event. More...
 
void eventLoadRemote (Event *t, Handle handle, bool autoclear)
 Loads a kernel-mode event obtained from IPC. More...
 
void eventClose (Event *t)
 Closes a kernel-mode event. More...
 
static bool eventActive (Event *t)
 Returns whether an Event is initialized. More...
 
Result eventWait (Event *t, u64 timeout)
 Waits on a kernel-mode event. More...
 
Result eventFire (Event *t)
 Signals a kernel-mode event. More...
 
Result eventClear (Event *t)
 Clears a kernel-mode event. More...
 

Detailed Description

Kernel-mode event synchronization primitive.

Author
plutoo

Function Documentation

◆ eventActive()

static bool eventActive ( Event t)
inlinestatic

Returns whether an Event is initialized.

Parameters
[in]tPointer to Event structure.
Returns
Initialization status.

◆ eventClear()

Result eventClear ( Event t)

Clears a kernel-mode event.

Parameters
[in]tPointer to Event structure.
Returns
Result code.
Note
This function shouldn't be used on autoclear events.

◆ eventClose()

void eventClose ( Event t)

Closes a kernel-mode event.

Parameters
[in]tPointer to Event structure.

◆ eventCreate()

Result eventCreate ( Event t,
bool  autoclear 
)

Creates a kernel-mode event.

Parameters
[out]tPointer to Event structure.
[in]autoclearAutoclear flag.
Returns
Result code.
Warning
This is a privileged operation; in normal circumstances applications shouldn't use this function.

◆ eventFire()

Result eventFire ( Event t)

Signals a kernel-mode event.

Parameters
[in]tPointer to Event structure.
Returns
Result code.
Note
This function only works for events initialized with eventCreate, it doesn't work with events initialized with eventLoadRemote.
Warning
This is a privileged operation; in normal circumstances applications shouldn't use this function.

◆ eventLoadRemote()

void eventLoadRemote ( Event t,
Handle  handle,
bool  autoclear 
)

Loads a kernel-mode event obtained from IPC.

Parameters
[out]tPointer to Event structure.
[in]handleRead-only event handle.
[in]autoclearAutoclear flag.

◆ eventWait()

Result eventWait ( Event t,
u64  timeout 
)

Waits on a kernel-mode event.

Parameters
[in]tPointer to Event structure.
[in]timeoutTimeout in nanoseconds (pass UINT64_MAX to wait indefinitely).
Returns
Result code.