![]() |
ARX
1.2.0
The next-generation open source augmented reality toolkit.
|
#include <ARX/ARUtil/types.h>Go to the source code of this file.
Typedefs | |
| typedef struct _THREAD_HANDLE_T | THREAD_HANDLE_T |
Functions | |
| ARUTIL_EXTERN THREAD_HANDLE_T * | threadInit (int ID, void *arg, void *(*start_routine)(THREAD_HANDLE_T *)) |
| Client-side, set up. | |
| ARUTIL_EXTERN int | threadFree (THREAD_HANDLE_T **flag) |
| Client-side, set up. Frees structures associated with the thread handle pointed to by the location pointed to by flag. Thread should already have terminated (i.e. threadWaitQuit() has returned). Location pointed to by flag is set to NULL. | |
| ARUTIL_EXTERN int | threadStartSignal (THREAD_HANDLE_T *flag) |
| Client-side, communication. Send the worker thread the "start processing" request. | |
| ARUTIL_EXTERN int | threadGetStatus (THREAD_HANDLE_T *flag) |
| Client-side, communication. Find out (without waiting) whether a worker has ended. 0 = not started or started but not yet ended, 1 = ended. | |
| ARUTIL_EXTERN int | threadGetBusyStatus (THREAD_HANDLE_T *flag) |
| Client-side, communication. Find out if a worker is currently busy. 0 = worker not started or worker ended, 1 = worker started but not yet ended. | |
| ARUTIL_EXTERN int | threadEndWait (THREAD_HANDLE_T *flag) |
| Client-side, communication. Wait for thread to end processing. | |
| ARUTIL_EXTERN int | threadWaitQuit (THREAD_HANDLE_T *flag) |
| Client-side, communication. Tell a thread waiting for the "start processing" request to quit (exit), and wait until this has happened. | |
| ARUTIL_EXTERN int | threadStartWait (THREAD_HANDLE_T *flag) |
| Worker-side. | |
| ARUTIL_EXTERN int | threadEndSignal (THREAD_HANDLE_T *flag) |
| Worker-side. Notify anyone waiting that the worker has ended. | |
| ARUTIL_EXTERN int | threadGetID (THREAD_HANDLE_T *flag) |
| Worker-side. Get the 'ID' value passed to the thread's start routine. | |
| ARUTIL_EXTERN void * | threadGetArg (THREAD_HANDLE_T *flag) |
| Worker-side. Get the 'arg' value passed to the thread's start routine. | |
| ARUTIL_EXTERN int | threadGetCPU (void) |
| Returns the number of online CPUs in the system. | |
| typedef struct _THREAD_HANDLE_T THREAD_HANDLE_T |
| ARUTIL_EXTERN int threadEndSignal | ( | THREAD_HANDLE_T * | flag | ) |
Worker-side. Notify anyone waiting that the worker has ended.
| ARUTIL_EXTERN int threadEndWait | ( | THREAD_HANDLE_T * | flag | ) |
Client-side, communication. Wait for thread to end processing.
| ARUTIL_EXTERN int threadFree | ( | THREAD_HANDLE_T ** | flag | ) |
Client-side, set up. Frees structures associated with the thread handle pointed to by the location pointed to by flag. Thread should already have terminated (i.e. threadWaitQuit() has returned). Location pointed to by flag is set to NULL.
| ARUTIL_EXTERN void * threadGetArg | ( | THREAD_HANDLE_T * | flag | ) |
Worker-side. Get the 'arg' value passed to the thread's start routine.
| ARUTIL_EXTERN int threadGetBusyStatus | ( | THREAD_HANDLE_T * | flag | ) |
Client-side, communication. Find out if a worker is currently busy. 0 = worker not started or worker ended, 1 = worker started but not yet ended.
| ARUTIL_EXTERN int threadGetCPU | ( | void | ) |
Returns the number of online CPUs in the system.
| ARUTIL_EXTERN int threadGetID | ( | THREAD_HANDLE_T * | flag | ) |
Worker-side. Get the 'ID' value passed to the thread's start routine.
| ARUTIL_EXTERN int threadGetStatus | ( | THREAD_HANDLE_T * | flag | ) |
Client-side, communication. Find out (without waiting) whether a worker has ended. 0 = not started or started but not yet ended, 1 = ended.
| ARUTIL_EXTERN THREAD_HANDLE_T * threadInit | ( | int | ID, |
| void * | arg, | ||
| void * | start_routine (*)(THREAD_HANDLE_T *) ) |
Client-side, set up.
Create a new thread, and launch start_routine() on it. Returns NULL in case of failure.
Example client structure:
| ARUTIL_EXTERN int threadStartSignal | ( | THREAD_HANDLE_T * | flag | ) |
Client-side, communication. Send the worker thread the "start processing" request.
| ARUTIL_EXTERN int threadStartWait | ( | THREAD_HANDLE_T * | flag | ) |
Worker-side.
Wait for the "start processing" request. Returns 0 if worker should start, or -1 if worker should quit (exit).
Example worker structure:
| ARUTIL_EXTERN int threadWaitQuit | ( | THREAD_HANDLE_T * | flag | ) |
Client-side, communication. Tell a thread waiting for the "start processing" request to quit (exit), and wait until this has happened.
1.18.0