lightningd/msg_queue: add msg_wake helper.

A cleaner wrapper than a raw io_wake.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2017-04-12 09:10:10 -07:00
committed by Christian Decker
parent d967c2ba64
commit a436fa77fc
3 changed files with 12 additions and 4 deletions

View File

@@ -15,12 +15,15 @@ struct msg_queue {
void msg_queue_init(struct msg_queue *q, const tal_t *ctx);
/* If add is taken(), freed after sending. */
/* If add is taken(), freed after sending. msg_wake() implied. */
void msg_enqueue(struct msg_queue *q, const u8 *add);
/* Fd is closed after sending. */
/* Fd is closed after sending. msg_wake() implied. */
void msg_enqueue_fd(struct msg_queue *q, int fd);
/* Explicitly wake up a msg_queue_wait */
void msg_wake(const struct msg_queue *q);
/* Returns NULL if nothing to do. */
const u8 *msg_dequeue(struct msg_queue *q);