#include <time.h>
#include <pthread.h>
#include <unistd.h>
◆ vl_posix_thread
Data Fields |
pthread_t |
threadHandle |
|
pthread_cond_t |
timeoutCondition |
|
pthread_mutex_t |
timeoutConditionMutex |
|
◆ vl_thread_args
◆ vl_ThreadBootstrap()
void * vl_ThreadBootstrap |
( |
void * | arg | ) |
|
◆ vlThreadCurrent()
Gets the current thread.
- Returns
- vl_thread representing the current thread.
◆ vlThreadDelete()
Deletes the specified thread.
- Warning
- This will result in undefined behavior if the thread has not been joined prior to calling this function.
- See also
- vlThreadJoin
-
vlThreadJoinTimeout
- Parameters
-
thread | which thread to delete |
◆ vlThreadExit()
Exits the calling thread.
- Note
- Does not return to the caller.
◆ vlThreadJoin()
Joins the specified thread, halting the calling thread until the specified thread exits.
- Note
- If the specified thread happens to be the main thread, this will return false.
- Parameters
-
- Returns
- true on success, false on error.
◆ vlThreadJoinTimeout()
Attempts to join the specified thread until a maximum amount of time has passed.
- Note
- Will always return false is trying to join the main thread.
- Parameters
-
- Returns
- true on success, false on timeout or error.
◆ vlThreadNew()
Creates and begins executing a new thread.
- Note
- May return VL_THREAD_NULL on failure.
- Parameters
-
- Returns
- thread handle
◆ vlThreadSleep()
Sleeps the current thread a specified total number of milliseconds.
- Parameters
-
◆ vlThreadYield()
Yields the execution of the current thread, allowing another thread to take the remainder of its timeslice.
- Returns
- a boolean indicating if the yield operation occurred. May return false if there is no other thread to yield to.
◆ currentThread
Thread local pointer to the metadata of the current thread.
◆ mainThread