Rename uc_thread_queue_get to uc_thread_queue_tryget, introduce
uc_thread_queue_get macro
This commit is contained in:
@@ -175,7 +175,7 @@ int uc_thread_queue_add(struct uc_threadqueue *queue, struct uc_threadmsg *msg);
|
||||
/**
|
||||
* Gets a message from a queue
|
||||
*
|
||||
* thread_queue_get gets a message from the specified queue, it will block
|
||||
* thread_queue_tryget gets a message from the specified queue, it will block
|
||||
* the caling thread untill a message arrives, or the (optional) timeout occurs.
|
||||
* If timeout is NULL, there will be no timeout, and thread_queue_get will wait
|
||||
* untill a message arrives.
|
||||
@@ -194,7 +194,15 @@ int uc_thread_queue_add(struct uc_threadqueue *queue, struct uc_threadmsg *msg);
|
||||
*
|
||||
* @return 0 on success EINVAL if queue is NULL ETIMEDOUT if timeout occurs
|
||||
*/
|
||||
int uc_thread_queue_get(struct uc_threadqueue *queue, const struct timespec *timeout, struct uc_threadmsg **msg);
|
||||
int uc_thread_queue_tryget(struct uc_threadqueue *queue, const struct timespec *timeout, struct uc_threadmsg **msg);
|
||||
|
||||
/**
|
||||
* Like uc_thread_queue_tryget, but will wait indefintly for an item
|
||||
* to become available
|
||||
* @see uc_thread_queue_tryget
|
||||
*/
|
||||
#define uc_thread_queue_get(queue, msg)\
|
||||
uc_thread_queue_tryget(queue, NULL, msg)
|
||||
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user