wavelength 1.0.0
Loading...
Searching...
No Matches
asynctask.h File Reference

Go to the source code of this file.

Typedefs

typedef int(* AsyncTaskFunc) ()
 Routine the worker thread runs.
typedef void(* AsyncTaskDoneFunc) (int nResult)
 Routine the main thread runs once the worker thread has run the task.

Functions

void InitAsyncTasks ()
 Start the worker thread that runs queued tasks one at a time, at priority 1.
void TerminateAsyncTasks ()
 Delete the worker thread.
void EnqueueAsyncTask (AsyncTaskFunc pfnTask, AsyncTaskDoneFunc pfnDone)
 Queue a task for the worker thread.
void PollAsyncTasks ()
 Run the completion of a finished task, and wake the worker for the next queued task.

Typedef Documentation

◆ AsyncTaskFunc

typedef int(* AsyncTaskFunc) ()

Routine the worker thread runs.

Returns
The result passed to the routine's completion.

◆ AsyncTaskDoneFunc

typedef void(* AsyncTaskDoneFunc) (int nResult)

Routine the main thread runs once the worker thread has run the task.

Parameters
nResultThe result of the task.

Function Documentation

◆ InitAsyncTasks()

void InitAsyncTasks ( )

Start the worker thread that runs queued tasks one at a time, at priority 1.

A failure to create the semaphore or the thread is reported and leaves no worker.

The name is inferred. SystemInit() calls it.

Ghidra address:
NTSC-U/C: 0x0028cd60
Ghidra address:
PAL: 0x00296740

◆ TerminateAsyncTasks()

void TerminateAsyncTasks ( )

Delete the worker thread.

SystemTerminate() calls it.

The name is inferred.

Ghidra address:
NTSC-U/C: 0x0028ce70
Ghidra address:
PAL: 0x00296850

◆ EnqueueAsyncTask()

void EnqueueAsyncTask ( AsyncTaskFunc pfnTask,
AsyncTaskDoneFunc pfnDone )

Queue a task for the worker thread.

The queue holds five tasks and wraps without checking for room.

The name is inferred.

Parameters
pfnTaskThe task.
pfnDoneThe completion, which PollAsyncTasks() runs on the main thread.
Ghidra address:
NTSC-U/C: 0x0028cf18
Ghidra address:
PAL: 0x002968f8

◆ PollAsyncTasks()

void PollAsyncTasks ( )

Run the completion of a finished task, and wake the worker for the next queued task.

SystemPoll() calls it once per frame.

The name is inferred.

Ghidra address:
NTSC-U/C: 0x0028cf60
Ghidra address:
PAL: 0x00296940