Rename uc_thread_queue_get to uc_thread_queue_tryget, introduce

uc_thread_queue_get macro
This commit is contained in:
Nils O. Selåsdal
2013-01-01 21:13:29 +01:00
parent 1b5645ae47
commit dbe91d2d13
3 changed files with 17 additions and 9 deletions
+10 -2
View File
@@ -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)
/**