TLIB documentationOS independant thread management routines for TLIB.
#include "tlVision.h"


Go to the source code of this file.
Functions | |
| int | tlThreadCreate (TLTHREAD_FUNC_PTR func, tlThreadHandle *handle) |
| void | tlThreadExit (int returnCode) |
| int | tlThreadKill (tlThreadHandle *handle) |
| int | tlThreadChangePriority (tlThreadHandle *handle, int priority) |
| int | tlThreadJoin (tlThreadHandle *handle, int *returnCode, int timeout) |
| void | tlThreadSleep (unsigned int msec) |
| int tlThreadChangePriority | ( | tlThreadHandle * | handle, | |
| int | priority | |||
| ) |
Change thread priority.
| handle | pointer to the thread identifier | |
| priority | priority to give to the thread |
| int tlThreadCreate | ( | TLTHREAD_FUNC_PTR | func, | |
| tlThreadHandle * | handle | |||
| ) |
Create a thread. On success, the identifier of the newly created thread is stored in handle and 0 is returned. On error, a non-zero error code is returned.
| func | pointer to the function to run in thread | |
| handle | [out] thread identifier |
| void tlThreadExit | ( | int | returnCode | ) |
Exit the thread (from within the thread). The return value of the thread can be consulted from another thread using tlThreadJoin().
| returnCode | return value of the exiting thread on success, -1 otherwise. See error management for details. |
| int tlThreadJoin | ( | tlThreadHandle * | handle, | |
| int * | returnCode, | |||
| int | timeout | |||
| ) |
Block until the thread exits.
| handle | pointer to the thread identifier | |
| returnCode | priority to give to the thread | |
| timeout | time limit before the function returns (msec) |
| int tlThreadKill | ( | tlThreadHandle * | handle | ) |
Kill the thread.
| handle | pointer to the thread identifier |
| void tlThreadSleep | ( | unsigned int | msec | ) |
Suspend execution for a period.
| msec | sleep period (msec) |