/*
* Change under task exclusive.
*/
-static unsigned int ioqversion;
+static unsigned int generation;
static void
mutex_init(void) {
DNS_LOGMODULE_DNSTAP, ISC_LOG_INFO,
"opening dnstap destination '%s'", path);
- ioqversion++;
+ generation++;
env = isc_mem_get(mctx, sizeof(dns_dtenv_t));
if (env == NULL)
"%s dnstap destination '%s'",
(roll < 0) ? "reopening" : "rolling",
env->path);
+
+ generation++;
if (env->iothr != NULL)
fstrm_iothr_destroy(&env->iothr);
- ioqversion++;
-
if (env->mode == dns_dtmode_file && roll >= 0) {
/*
* Create a temporary isc_logfile_t structure so we can
dt_queue(dns_dtenv_t *env) {
isc_result_t result;
struct ioq {
- unsigned int ioqversion;
+ unsigned int generation;
struct fstrm_iothr_queue *ioq;
} *ioq;
return (NULL);
ioq = (struct ioq *)isc_thread_key_getspecific(dt_key);
- if (ioq != NULL && ioq->ioqversion != ioqversion) {
+ if (ioq != NULL && ioq->generation != generation) {
result = isc_thread_key_setspecific(dt_key, NULL);
if (result != ISC_R_SUCCESS)
return (NULL);
ioq = malloc(sizeof(*ioq));
if (ioq == NULL)
return (NULL);
- ioq->ioqversion = ioqversion;
+ ioq->generation = generation;
ioq->ioq = fstrm_iothr_get_input_queue(env->iothr);
if (ioq->ioq == NULL) {
free(ioq);
"closing dnstap");
env->magic = 0;
- ioqversion++;
+ generation++;
if (env->iothr != NULL)
fstrm_iothr_destroy(&env->iothr);