From 14c9712edef594e3701c8851d7c51b109a6da97d Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Mon, 3 Jul 2017 10:24:59 -0700 Subject: Remove the unused infinite timeout versions of msgq. --- src/core/msgqueue.h | 41 +++++++++++++++++------------------------ 1 file changed, 17 insertions(+), 24 deletions(-) (limited to 'src/core/msgqueue.h') diff --git a/src/core/msgqueue.h b/src/core/msgqueue.h index b0a33562..485eb9e7 100644 --- a/src/core/msgqueue.h +++ b/src/core/msgqueue.h @@ -43,32 +43,25 @@ extern void nni_msgq_aio_notify_get(nni_msgq *, nni_aio *); extern void nni_msgq_aio_notify_put(nni_msgq *, nni_aio *); // nni_msgq_put puts the message to the queue. It blocks until it -// was able to do so, or the queue is closed, returning either 0 on -// success or NNG_ECLOSED if the queue was closed. If NNG_ECLOSED is -// returned, the caller is responsible for freeing the message with -// nni_msg_free(), otherwise the message is "owned" by the queue, and -// the caller is not permitted to access it further. -extern int nni_msgq_put(nni_msgq *, nni_msg *); - -// nni_msgq_tryput is like nni_msgq_put, except that it does not block, -// if there is no room to put the message it simply returns NNG_EAGAIN. -extern int nni_msgq_tryput(nni_msgq *, nni_msg *); - -// nni_msgq_get gets the message from the queue. It blocks until a -// message is available, or the queue is closed, returning either 0 on -// success or NNG_ECLOSED if the queue was closed. If a message is -// provided, the caller is assumes ownership of the message and must -// call nni_msg_free() when it is finished with it. -extern int nni_msgq_get(nni_msgq *, nni_msg **); - -// nni_msgq_put_until is like nni_msgq_put, except that if the -// system clock reaches the specified time without being able to place -// the message in the queue, it will return NNG_ETIMEDOUT. +// was able to do so, or the queue is closed, or a timeout is reached. +// It returns 0 on success, NNG_ECLOSED if the queue was closed, or +// NNG_ETIMEDOUT if the timeout is reached. If an error is returned, +// the caller is responsible for freeing the message with nni_msg_free(), +// otherwise the message is "owned" by the queue, and the caller is not +// permitted to access it further. extern int nni_msgq_put_until(nni_msgq *, nni_msg *, nni_time); -// nni_msgq_get_until is like nni_msgq_put, except that if the -// system clock reaches the specified time without being able to retrieve -// a message from the queue, it will return NNG_ETIMEDOUT. +// nni_msgq_tryput performs a non-blocking attempt to put a message on +// the message queue. It is the same as calling nng_msgq_put_until with +// a zero time. +extern int nni_msgq_tryput(nni_msgq *, nni_msg *); + +// nni_msgq_get_until gets a message from the queue. It blocks until a +// message is available, the queue is closed, or time out is reached. +// It returns 0 on success, NNG_ECLOSED if the queue was closed, or +// NNG_ETIMEDOUT if the timeout is reached. On successful return, +// the caller assumes ownership of the message and must call +// nni_msg_free() when it is finished with it. extern int nni_msgq_get_until(nni_msgq *, nni_msg **, nni_time); // nni_msgq_set_error sets an error condition on the message queue, -- cgit v1.2.3-70-g09d2