|
wavelength 1.0.0
|
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 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.
| nResult | The result of the task. |
| 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.
| void TerminateAsyncTasks | ( | ) |
Delete the worker thread.
SystemTerminate() calls it.
The name is inferred.
| 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.
| pfnTask | The task. |
| pfnDone | The completion, which PollAsyncTasks() runs on the main thread. |
| 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.