).
Defines | |
#define | VXITRD_DEFINE_THREAD_FUNC(funcName, userData) VXItrdThreadArg funcName(VXItrdThreadArg userData) |
Typedefs | |
typedef VXItrdThreadArg(* | VXItrdThreadStartFunc )(VXItrdThreadArg userData) |
typedef enum VXItrdResult | VXItrdResult |
Result codes for functions. | |
Enumerations | |
enum | VXItrdResult { VXItrd_RESULT_FATAL_ERROR = -100, VXItrd_RESULT_IO_ERROR = -8, VXItrd_RESULT_OUT_OF_MEMORY = -7, VXItrd_RESULT_SYSTEM_ERROR = -6, VXItrd_RESULT_PLATFORM_ERROR = -5, VXItrd_RESULT_BUFFER_TOO_SMALL = -4, VXItrd_RESULT_INVALID_PROP_NAME = -3, VXItrd_RESULT_INVALID_PROP_VALUE = -2, VXItrd_RESULT_INVALID_ARGUMENT = -1, VXItrd_RESULT_SUCCESS = 0, VXItrd_RESULT_FAILURE = 1, VXItrd_RESULT_NON_FATAL_ERROR = 2, VXItrd_RESULT_UNSUPPORTED = 100 } |
Result codes for functions. More... | |
Functions | |
VXITRD_API VXItrdResult | VXItrdMutexCreate (VXItrdMutex **mutex) |
Create a mutex. | |
VXITRD_API VXItrdResult | VXItrdMutexDestroy (VXItrdMutex **mutex) |
Destroy a mutex. | |
VXITRD_API VXItrdResult | VXItrdMutexLock (VXItrdMutex *mutex) |
Lock a mutex. | |
VXITRD_API VXItrdResult | VXItrdMutexUnlock (VXItrdMutex *mutex) |
Unlock a Mutex. | |
VXITRD_API VXItrdResult | VXItrdThreadCreate (VXItrdThread **thread, VXItrdThreadStartFunc startFunc, VXItrdThreadArg arg) |
Create a thread. | |
VXITRD_API VXItrdResult | VXItrdThreadDestroyHandle (VXItrdThread **thread) |
Destroy a thread handle. | |
VXITRD_API void | VXItrdThreadExit (VXItrdThreadArg status) |
Terminate a thread (called by the thread to exit). | |
VXITRD_API VXItrdResult | VXItrdThreadJoin (VXItrdThread *thread, VXItrdThreadArg *status, long timeout) |
Wait for the termination of a specified thread. | |
VXITRD_API VXIthreadID | VXItrdThreadGetIDFromHandle (VXItrdThread *thread) |
Get the thread ID for the specified thread. | |
VXITRD_API VXIthreadID | VXItrdThreadGetID (void) |
Get the thread ID for the current thread. | |
VXITRD_API void | VXItrdThreadYield (void) |
Yield execution of the current thread to other threads/processes. | |
VXITRD_API VXItrdResult | VXItrdTimerCreate (VXItrdTimer **timer) |
Create a timer. | |
VXITRD_API VXItrdResult | VXItrdTimerDestroy (VXItrdTimer **timer) |
Destroy a timer. | |
VXITRD_API VXItrdResult | VXItrdTimerSleep (VXItrdTimer *timer, VXIint sleepMs, VXIbool *interrupted) |
Suspend the current thread for a time period using a timer. | |
VXITRD_API VXItrdResult | VXItrdTimerWake (VXItrdTimer *timer) |
Wakes a thread that is sleeping on a timer. | |
VXITRD_API VXItrdResult | VXItrdInit (VXIint32 threadStackSize) |
Initialize the TRD utilities library. | |
VXITRD_API VXItrdResult | VXItrdShutDown (void) |
Shutdown the TRD utilities library. | |
Variables | |
*typedef void * | VXItrdThreadArg |
Function signature invoked on the new thread by VXItrdThreadCreate( ), and the argument to that function. |
|
|
|
Result codes for functions. Result codes less then zero are severe errors (likely to be platform faults), those greater then zero are warnings (likely to be application issues) |
|
|
|
|
Initialize the TRD utilities library.
|
|
Create a mutex.
|
|
Destroy a mutex.
|
|
Lock a mutex.
|
|
Unlock a Mutex.
|
|
Shutdown the TRD utilities library.
|
|
Create a thread. Note thread values are not supported on some older operating systems (such as IBM OS/2). Execution starts on the thread immediately. To pause execution use a mutex between the thread and the thread creator.
|
|
Destroy a thread handle. Note: this does NOT stop or destroy the thread, it just releases the handle for accessing it. If this is not done, a memory leak occurs, so if the creator of the thread never needs to communicate with the thread again it should call this immediately after the create if the create was successful.
|
|
Terminate a thread (called by the thread to exit).
|
|
Get the thread ID for the current thread.
|
|
Get the thread ID for the specified thread.
|
|
Wait for the termination of a specified thread.
|
|
Yield execution of the current thread to other threads/processes.
|
|
Create a timer.
|
|
Destroy a timer.
|
|
Suspend the current thread for a time period using a timer. Note: due to other activities of the machine, the delay may be greater then the configured duration.
|
|
Wakes a thread that is sleeping on a timer. Note: if no thread is currently waiting on the specified timer, the next VXItrdTimerSleep( ) call on that timer will immediately wake up.
|
|
Function signature invoked on the new thread by VXItrdThreadCreate( ), and the argument to that function.
|