Vortex Thread: Portable threading API for vortex


Defines

#define VORTEX_COND_TIMEDWAIT(r, c, mutex, m)
 Useful macro that allows to perform a call to vortex_cond_timewait registering the place where the call was started and ended.
#define VORTEX_COND_WAIT(c, mutex)
 Useful macro that allows to perform a call to vortex_cond_wait registering the place where the call was started and ended.

Functions

void vortex_async_queue_foreach (VortexAsyncQueue *queue, VortexAsyncQueueForeach foreach_func, axlPointer user_data)
 Allows to perform a foreach operation on the provided queue, applying the provided function over all items stored.
int vortex_async_queue_items (VortexAsyncQueue *queue)
 Allows to get current items installed on the queue, pending to be readed.
int vortex_async_queue_length (VortexAsyncQueue *queue)
 Allows to get current queue status.
VortexAsyncQueuevortex_async_queue_new ()
 Creates a new async message queue, a inter thread communication that allows to communicate and synchronize data between threads inside the same process.
axlPointer vortex_async_queue_pop (VortexAsyncQueue *queue)
 Pop the first data available in the queue, locking the calling if no data is available.
void vortex_async_queue_priority_push (VortexAsyncQueue *queue, axlPointer data)
 Allows to push data into the queue but moving the reference provided into the queue head (causing next call to vortex_async_queue_pop to receive this reference).
void vortex_async_queue_push (VortexAsyncQueue *queue, axlPointer data)
 Allows to push data into the queue.
void vortex_async_queue_ref (VortexAsyncQueue *queue)
 Allows to update the reference counting for the provided queue.
axlPointer vortex_async_queue_timedpop (VortexAsyncQueue *queue, long int microseconds)
 Pop the first data available in the queue, locking the calling if no data is available, but bounding the waiting to the value provided.
void vortex_async_queue_unref (VortexAsyncQueue *queue)
 Decrease the reference counting deallocating all resources associated with the queue if such counting reach zero.
int vortex_async_queue_waiters (VortexAsyncQueue *queue)
 Allows to get current waiting threads on the provided queue.
void vortex_cond_broadcast (VortexCond *cond)
 Restarts all the threads that are waiting on the condition variable cond.
axl_bool vortex_cond_create (VortexCond *cond)
 Initializes the condition variable cond.
void vortex_cond_destroy (VortexCond *cond)
 Destroys a condition variable, freeing the resources it might hold.
void vortex_cond_signal (VortexCond *cond)
 Restarts one of the threads that are waiting on the condition variable cond.
axl_bool vortex_cond_timedwait (VortexCond *cond, VortexMutex *mutex, long int microseconds)
 Atomically unlocks mutex and waits on cond, as pthread_cond_wait does, but it also bounds the duration of the wait.
axl_bool vortex_cond_wait (VortexCond *cond, VortexMutex *mutex)
 Atomically unlocks the mutex (as per vortex_mutex_unlock) and waits for the condition variable cond to be signaled.
axl_bool vortex_mutex_create (VortexMutex *mutex_def)
 Allows to create a new mutex to protect critical sections to be executed by several threads at the same time.
axl_bool vortex_mutex_destroy (VortexMutex *mutex_def)
 Destroy the provided mutex, freeing the resources it might hold.
void vortex_mutex_lock (VortexMutex *mutex_def)
 Locks the given mutex.
void vortex_mutex_unlock (VortexMutex *mutex_def)
 Unlocks the given mutex.
axl_bool vortex_thread_create (VortexThread *thread_def, VortexThreadFunc func, axlPointer user_data,...)
 Creates a new thread, executing the function provided, passing the referece received to the function (user_data).
axl_bool vortex_thread_destroy (VortexThread *thread_def, axl_bool free_data)
 Wait for the provided thread to finish, destroy its resources and optionally release its pointer.