Macros | Functions
Vortex Thread: Portable threading API for vortex

Macros

#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. More...
 
#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. More...
 

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. More...
 
int vortex_async_queue_items (VortexAsyncQueue *queue)
 Allows to get current items installed on the queue, pending to be readed. More...
 
int vortex_async_queue_length (VortexAsyncQueue *queue)
 Allows to get current queue status. More...
 
void vortex_async_queue_lock (VortexAsyncQueue *queue)
 Allows to lock the queue, making the caller the only thread owning the queue. More...
 
axlPointer vortex_async_queue_lookup (VortexAsyncQueue *queue, axlLookupFunc lookup_func, axlPointer user_data)
 Allows to iterate over queue elements applying a lookup function to select one. More...
 
VortexAsyncQueuevortex_async_queue_new (void)
 Creates a new async message queue, a inter thread communication that allows to communicate and synchronize data between threads inside the same process. More...
 
axlPointer vortex_async_queue_pop (VortexAsyncQueue *queue)
 Pop the first data available in the queue, locking the calling if no data is available. More...
 
axl_bool 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). More...
 
axl_bool vortex_async_queue_push (VortexAsyncQueue *queue, axlPointer data)
 Allows to push data into the queue. More...
 
axl_bool vortex_async_queue_ref (VortexAsyncQueue *queue)
 Allows to update the reference counting for the provided queue. More...
 
int vortex_async_queue_ref_count (VortexAsyncQueue *queue)
 Returns current reference counting for the provided queue. More...
 
void vortex_async_queue_safe_unref (VortexAsyncQueue **queue)
 Allows to perform a safe unref operation (nullifying the caller's queue reference). More...
 
axlPointer vortex_async_queue_timedpop (VortexAsyncQueue *queue, long 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. More...
 
void vortex_async_queue_unlock (VortexAsyncQueue *queue)
 Allows to unlock the queue. More...
 
axl_bool vortex_async_queue_unlocked_push (VortexAsyncQueue *queue, axlPointer data)
 Allows to push data into the queue withtout acquiring the internal lock. More...
 
void vortex_async_queue_unref (VortexAsyncQueue *queue)
 Decrease the reference counting deallocating all resources associated with the queue if such counting reach zero. More...
 
int vortex_async_queue_waiters (VortexAsyncQueue *queue)
 Allows to get current waiting threads on the provided queue. More...
 
void vortex_cond_broadcast (VortexCond *cond)
 Restarts all the threads that are waiting on the condition variable cond. More...
 
axl_bool vortex_cond_create (VortexCond *cond)
 Initializes the condition variable cond. More...
 
void vortex_cond_destroy (VortexCond *cond)
 Destroys a condition variable, freeing the resources it might hold. More...
 
void vortex_cond_signal (VortexCond *cond)
 Restarts one of the threads that are waiting on the condition variable cond. More...
 
axl_bool vortex_cond_timedwait (VortexCond *cond, VortexMutex *mutex, long microseconds)
 Atomically unlocks mutex and waits on cond, as pthread_cond_wait does, but it also bounds the duration of the wait. More...
 
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. More...
 
axl_bool vortex_mutex_create (VortexMutex *mutex_def)
 Allows to create a new non-recursive mutex to protect critical sections to be executed by several threads at the same time. More...
 
axl_bool vortex_mutex_create_full (VortexMutex *mutex_def, VortexMutexConf conf)
 Allows to create a new mutex to protect critical sections to be executed by several threads at the same time, with extended options. More...
 
axl_bool vortex_mutex_destroy (VortexMutex *mutex_def)
 Destroy the provided mutex, freeing the resources it might hold. More...
 
void vortex_mutex_lock (VortexMutex *mutex_def)
 Locks the given mutex. More...
 
void vortex_mutex_unlock (VortexMutex *mutex_def)
 Unlocks the given mutex. More...
 
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). More...
 
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. More...
 
void vortex_thread_set_create (VortexThreadCreateFunc create_fn)
 Allows to specify the function Vortex library will call to create a new thread. More...
 
void vortex_thread_set_destroy (VortexThreadDestroyFunc destroy_fn)
 Allows to specify the function Vortex library will call to destroy a thread's resources. More...
 

Detailed Description