Make _get and _add function inline instead of defines

This commit is contained in:
Nils O. Selåsdal
2013-01-02 21:24:59 +01:00
parent 22d15ea1a1
commit b5a8796ab9
+8 -4
View File
@@ -177,8 +177,10 @@ int uc_thread_queue_tryadd(struct uc_threadqueue *queue, const struct timespec *
* Like uc_thread_queue_add but will wait indefintly.
* @see uc_thread_queue_add
*/
#define uc_thread_queue_add(queue, msg)\
uc_thread_queue_tryadd(queue, NULL, msg)
static inline int uc_thread_queue_add(struct uc_threadqueue *queue, struct uc_threadmsg *msg)
{
return uc_thread_queue_tryadd(queue, NULL, msg);
}
/**
* Gets a message from a queue
@@ -209,8 +211,10 @@ int uc_thread_queue_tryget(struct uc_threadqueue *queue, const struct timespec *
* to become available
* @see uc_thread_queue_tryget
*/
#define uc_thread_queue_get(queue, msg)\
uc_thread_queue_tryget(queue, NULL, msg)
static inline int uc_thread_queue_get(struct uc_threadqueue *queue, struct uc_threadmsg **msg)
{
return uc_thread_queue_tryget(queue, NULL, msg);
}
/**