From 89c847f1f52969ee2ae6ed35018eef40366ca061 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Thu, 22 Dec 2016 17:38:46 -0800 Subject: Work on endpoints. More C99 & type cleanups. --- src/core/msgqueue.h | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src/core/msgqueue.h') diff --git a/src/core/msgqueue.h b/src/core/msgqueue.h index d97482af..adea2dfa 100644 --- a/src/core/msgqueue.h +++ b/src/core/msgqueue.h @@ -15,8 +15,18 @@ // Message queues. Message queues work in some ways like Go channels; // they are a thread-safe way to pass messages between subsystems. They // do have additional capabilities though. -typedef struct nni_msgqueue * nni_msgqueue_t; -typedef struct nni_msgqueue nni_msgqueue; +// +// A closed message queue cannot be written to, but if there are messages +// still in it, it can be read from. (This allows them to play a role in +// draining/lingering.) +// +// Message queues can be closed many times safely. +// +// Readers & writers in a message queue can be woken either by a timeout +// or by a specific signal (arranged by the caller). +// +// TODO: Add message queue growing, and pushback. +typedef struct nni_msgqueue nni_msgqueue; // nni_msgqueue_create creates a message queue with the given capacity, // which must be a positive number. It returns NNG_EINVAL if the capacity -- cgit v1.2.3-70-g09d2