{
uint8_t cmd = DTIO_COMMAND_WAKEUP;
if(!dtio) return;
- if(!dtio->event_base) return; /* not started */
+ if(!dtio->started) return;
while(1) {
ssize_t r = write(dtio->commandpipe[1], &cmd, sizeof(cmd));
#endif
/* start the thread */
+ dtio->started = 1;
ub_thread_create(&dtio->tid, dnstap_io, dtio);
return 1;
}
{
uint8_t cmd = DTIO_COMMAND_STOP;
if(!dtio) return;
- if(!dtio->event_base) return; /* not started */
+ if(!dtio->started) return;
+ verbose(VERB_ALGO, "dnstap io: send stop cmd");
while(1) {
ssize_t r = write(dtio->commandpipe[1], &cmd, sizeof(cmd));
}
break;
}
+ dtio->started = 0;
#ifndef USE_WINSOCK
close(dtio->commandpipe[1]);
struct dt_io_list_item* io_list_iter;
/** thread id, of the io thread */
ub_thread_type tid;
+ /** if the io processing has started */
+ int started;
/** file descriptor that the thread writes to */
int fd;