diff options
| author | Cy Schubert <cy@FreeBSD.org> | 2020-10-27 15:09:16 +0000 |
|---|---|---|
| committer | Cy Schubert <cy@FreeBSD.org> | 2020-10-27 15:09:16 +0000 |
| commit | 4cb89f2eee3bb358f0491932ab0498b5319f4229 (patch) | |
| tree | fc2691469564e7d7e552247f2b2c6e04dd7efb8a /dnstap/dtstream.h | |
| parent | 7973006f41cdaf144441d1a39f9f075053435e2f (diff) | |
Vendor import of Unbound 1.12.0.vendor/unbound/1.12.0
Notes
svn path=/vendor/unbound/dist/; revision=367082
svn path=/vendor/unbound/1.12.0/; revision=367083; tag=vendor/unbound/1.12.0
Diffstat (limited to 'dnstap/dtstream.h')
| -rw-r--r-- | dnstap/dtstream.h | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/dnstap/dtstream.h b/dnstap/dtstream.h index ede491f30d3e..f87d6dc8d386 100644 --- a/dnstap/dtstream.h +++ b/dnstap/dtstream.h @@ -49,6 +49,7 @@ struct dt_msg_entry; struct dt_io_list_item; struct dt_io_thread; struct config_file; +struct comm_base; /** * A message buffer with dnstap messages queued up. It is per-worker. @@ -68,11 +69,15 @@ struct dt_msg_queue { /** current size of the buffer, in bytes. data bytes of messages. * If a new message make it more than maxsize, the buffer is full */ size_t cursize; + /** number of messages in the queue */ + int msgcount; /** list of messages. The messages are added to the back and taken * out from the front. */ struct dt_msg_entry* first, *last; /** reference to the io thread to wakeup */ struct dt_io_thread* dtio; + /** the wakeup timer for dtio, on worker event base */ + struct comm_timer* wakeup_timer; }; /** @@ -166,6 +171,10 @@ struct dt_io_thread { * for the current message length that precedes the frame */ size_t cur_msg_len_done; + /** lock on wakeup_timer_enabled */ + lock_basic_type wakeup_timer_lock; + /** if wakeup timer is enabled in some thread */ + int wakeup_timer_enabled; /** command pipe that stops the pipe if closed. Used to quit * the program. [0] is read, [1] is written to. */ int commandpipe[2]; @@ -233,9 +242,10 @@ struct dt_io_list_item { /** * Create new (empty) worker message queue. Limit set to default on max. + * @param base: event base for wakeup timer. * @return NULL on malloc failure or a new queue (not locked). */ -struct dt_msg_queue* dt_msg_queue_create(void); +struct dt_msg_queue* dt_msg_queue_create(struct comm_base* base); /** * Delete a worker message queue. It has to be unlinked from access, @@ -258,6 +268,9 @@ void dt_msg_queue_delete(struct dt_msg_queue* mq); */ void dt_msg_queue_submit(struct dt_msg_queue* mq, void* buf, size_t len); +/** timer callback to wakeup dtio thread to process messages */ +void mq_wakeup_cb(void* arg); + /** * Create IO thread. * @return new io thread object. not yet started. or NULL malloc failure. |
