diff --git a/include/ucore/ucore_threadqueue.h b/include/ucore/ucore_threadqueue.h index 78b8496..383621d 100644 --- a/include/ucore/ucore_threadqueue.h +++ b/include/ucore/ucore_threadqueue.h @@ -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); +} /**