Macros | Functions
MyQtt Thread: Portable threading API for myqtt

Macros

#define MYQTT_COND_TIMEDWAIT(r, c, mutex, m)
 Useful macro that allows to perform a call to myqtt_cond_timewait registering the place where the call was started and ended. More...
 
#define MYQTT_COND_WAIT(c, mutex)
 Useful macro that allows to perform a call to myqtt_cond_wait registering the place where the call was started and ended. More...
 

Functions

void myqtt_async_queue_foreach (MyQttAsyncQueue *queue, MyQttAsyncQueueForeach 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 myqtt_async_queue_items (MyQttAsyncQueue *queue)
 Allows to get current items installed on the queue, pending to be readed. More...
 
int myqtt_async_queue_length (MyQttAsyncQueue *queue)
 Allows to get current queue status. More...
 
void myqtt_async_queue_lock (MyQttAsyncQueue *queue)
 Allows to lock the queue, making the caller the only thread owning the queue. More...
 
axlPointer myqtt_async_queue_lookup (MyQttAsyncQueue *queue, axlLookupFunc lookup_func, axlPointer user_data)
 Allows to iterate over queue elements applying a lookup function to select one. More...
 
MyQttAsyncQueuemyqtt_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 myqtt_async_queue_pop (MyQttAsyncQueue *queue)
 Pop the first data available in the queue, locking the calling if no data is available. More...
 
axl_bool myqtt_async_queue_priority_push (MyQttAsyncQueue *queue, axlPointer data)
 Allows to push data into the queue but moving the reference provided into the queue head (causing next call to myqtt_async_queue_pop to receive this reference). More...
 
axl_bool myqtt_async_queue_push (MyQttAsyncQueue *queue, axlPointer data)
 Allows to push data into the queue. More...
 
axl_bool myqtt_async_queue_ref (MyQttAsyncQueue *queue)
 Allows to update the reference counting for the provided queue. More...
 
int myqtt_async_queue_ref_count (MyQttAsyncQueue *queue)
 Returns current reference counting for the provided queue. More...
 
void myqtt_async_queue_safe_unref (MyQttAsyncQueue **queue)
 Allows to perform a safe unref operation (nullifying the caller's queue reference). More...
 
axlPointer myqtt_async_queue_timedpop (MyQttAsyncQueue *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 myqtt_async_queue_unlock (MyQttAsyncQueue *queue)
 Allows to unlock the queue. More...
 
axl_bool myqtt_async_queue_unlocked_push (MyQttAsyncQueue *queue, axlPointer data)
 Allows to push data into the queue withtout acquiring the internal lock. More...
 
void myqtt_async_queue_unref (MyQttAsyncQueue *queue)
 Decrease the reference counting deallocating all resources associated with the queue if such counting reach zero. More...
 
int myqtt_async_queue_waiters (MyQttAsyncQueue *queue)
 Allows to get current waiting threads on the provided queue. More...
 
void myqtt_cond_broadcast (MyQttCond *cond)
 Restarts all the threads that are waiting on the condition variable cond. More...
 
axl_bool myqtt_cond_create (MyQttCond *cond)
 Initializes the condition variable cond. More...
 
void myqtt_cond_destroy (MyQttCond *cond)
 Destroys a condition variable, freeing the resources it might hold. More...
 
void myqtt_cond_signal (MyQttCond *cond)
 Restarts one of the threads that are waiting on the condition variable cond. More...
 
axl_bool myqtt_cond_timedwait (MyQttCond *cond, MyQttMutex *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 myqtt_cond_wait (MyQttCond *cond, MyQttMutex *mutex)
 Atomically unlocks the mutex (as per myqtt_mutex_unlock) and waits for the condition variable cond to be signaled. More...
 
axl_bool myqtt_mutex_create (MyQttMutex *mutex_def)
 Allows to create a new mutex to protect critical sections to be executed by several threads at the same time. More...
 
axl_bool myqtt_mutex_destroy (MyQttMutex *mutex_def)
 Destroy the provided mutex, freeing the resources it might hold. More...
 
void myqtt_mutex_lock (MyQttMutex *mutex_def)
 Locks the given mutex. More...
 
void myqtt_mutex_unlock (MyQttMutex *mutex_def)
 Unlocks the given mutex. More...
 
axl_bool myqtt_thread_create (MyQttThread *thread_def, MyQttThreadFunc func, axlPointer user_data,...)
 Creates a new thread, executing the function provided, passing the referece received to the function (user_data). More...
 
axl_bool myqtt_thread_destroy (MyQttThread *thread_def, axl_bool free_data)
 Wait for the provided thread to finish, destroy its resources and optionally release its pointer. More...
 
void myqtt_thread_set_create (MyQttThreadCreateFunc create_fn)
 Allows to specify the function MyQtt library will call to create a new thread. More...
 
void myqtt_thread_set_destroy (MyQttThreadDestroyFunc destroy_fn)
 Allows to specify the function MyQtt library will call to destroy a thread's resources. More...
 

Detailed Description