MINOR: applet: adopt the wait list entry from the CLI
A few fields, including a generic list entry, were added to the CLI context
by commit 300decc8d9 ("MINOR: cli: extend the CLI context with a list and
two offsets"). It turns out that the list entry (l0) is solely used to
consult rings and that the generic ring_write() code is restricted to a
consumer on the CLI due to this, which was not the initial intent. Let's
make it a general purpose wait_entry field that is properly initialized
during appctx_init(). This will allow any applet to wait on a ring, not
just the CLI.
diff --git a/include/types/applet.h b/include/types/applet.h
index b990726..013c502 100644
--- a/include/types/applet.h
+++ b/include/types/applet.h
@@ -73,6 +73,7 @@
unsigned long thread_mask; /* mask of thread IDs authorized to process the applet */
struct task *t; /* task associated to the applet */
struct freq_ctr call_rate; /* appctx call rate */
+ struct list wait_entry; /* entry in a list of waiters for an event (e.g. ring events) */
union {
struct {
@@ -105,7 +106,6 @@
const char *msg; /* pointer to a persistent message to be returned in CLI_ST_PRINT state */
int severity; /* severity of the message to be returned according to (syslog) rfc5424 */
char *err; /* pointer to a 'must free' message to be returned in CLI_ST_PRINT_FREE state */
- struct list l0; /* General purpose list element, pointers, offsets and integers for... */
void *p0, *p1, *p2; /* ...registered commands, initialized to 0 by the CLI before first... */
size_t o0, o1; /* ...invocation of the keyword parser, except for the list element which... */
int i0, i1; /* ...is initialized with LIST_INIT(). */