|
CX Framework
Cross-platform C utility framework
|
Macros | |
| #define | tqStart taskqueueStart |
| #define | tqTick taskqueueTick |
| #define | tqShutdown(tq, wait) taskqueueStop(tq, wait) |
| #define | tqRelease(ptq) objRelease(ptq) |
Functions | |
| TaskQueue * | tqCreate (strref name, TaskQueueConfig *tqconfig) |
| #define tqRelease | ( | ptq | ) | objRelease(ptq) |
void tqRelease(TaskQueue **ptq)
Release a reference to a task queue. Decrements refcount and destroys queue when it reaches zero.
| ptq | Pointer to task queue pointer (set to NULL after release) |
Definition at line 111 of file taskqueue.h.
| #define tqShutdown | ( | tq, | |
| wait | |||
| ) | taskqueueStop(tq, wait) |
bool tqShutdown(TaskQueue *tq, int64 wait)
Attempt to shut down a queue. If wait is nonzero, will wait up to that duration for workers to exit.
| tq | Task queue to shut down |
| wait | Maximum time to wait for shutdown, or 0 for non-blocking |
Definition at line 104 of file taskqueue.h.
| #define tqStart taskqueueStart |
Start or re-start a queue to begin processing tasks. Spawns worker threads and begins task execution.
| tq | Task queue to start |
Definition at line 87 of file taskqueue.h.
| #define tqTick taskqueueTick |
int64 tqTick(TaskQueue *tq)
Tick a manual queue to process one or more tasks. Only valid for queues created with TQ_Manual flag.
| tq | Manual task queue to tick |
Definition at line 95 of file taskqueue.h.
| TaskQueue * tqCreate | ( | strref | name, |
| TaskQueueConfig * | tqconfig | ||
| ) |
TaskQueue *tqCreate(strref name, TaskQueueConfig *tqconfig)
Create a task queue but does not start it. Call tqStart() after creation to begin processing tasks.
| name | Name for the queue (used in logging and monitoring) |
| tqconfig | Configuration created with one of the tqPreset functions |