2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-30 22:15:20 +00:00

rename ioqversion -> generation; move increment before fstrm_iothr_destroy

This commit is contained in:
Mark Andrews
2016-08-24 22:06:00 -04:00
parent 5883460271
commit 7535dd93a1

View File

@@ -122,7 +122,7 @@ static isc_mem_t *dt_mctx = NULL;
/* /*
* Change under task exclusive. * Change under task exclusive.
*/ */
static unsigned int ioqversion; static unsigned int generation;
static void static void
mutex_init(void) { mutex_init(void) {
@@ -189,7 +189,7 @@ dns_dt_create(isc_mem_t *mctx, dns_dtmode_t mode, const char *path,
DNS_LOGMODULE_DNSTAP, ISC_LOG_INFO, DNS_LOGMODULE_DNSTAP, ISC_LOG_INFO,
"opening dnstap destination '%s'", path); "opening dnstap destination '%s'", path);
ioqversion++; generation++;
env = isc_mem_get(mctx, sizeof(dns_dtenv_t)); env = isc_mem_get(mctx, sizeof(dns_dtenv_t));
if (env == NULL) if (env == NULL)
@@ -327,11 +327,11 @@ dns_dt_reopen(dns_dtenv_t *env, int roll) {
(roll < 0) ? "reopening" : "rolling", (roll < 0) ? "reopening" : "rolling",
env->path); env->path);
generation++;
if (env->iothr != NULL) if (env->iothr != NULL)
fstrm_iothr_destroy(&env->iothr); fstrm_iothr_destroy(&env->iothr);
ioqversion++;
if (env->mode == dns_dtmode_file && roll >= 0) { if (env->mode == dns_dtmode_file && roll >= 0) {
/* /*
* Create a temporary isc_logfile_t structure so we can * Create a temporary isc_logfile_t structure so we can
@@ -415,7 +415,7 @@ static struct fstrm_iothr_queue *
dt_queue(dns_dtenv_t *env) { dt_queue(dns_dtenv_t *env) {
isc_result_t result; isc_result_t result;
struct ioq { struct ioq {
unsigned int ioqversion; unsigned int generation;
struct fstrm_iothr_queue *ioq; struct fstrm_iothr_queue *ioq;
} *ioq; } *ioq;
@@ -429,7 +429,7 @@ dt_queue(dns_dtenv_t *env) {
return (NULL); return (NULL);
ioq = (struct ioq *)isc_thread_key_getspecific(dt_key); 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); result = isc_thread_key_setspecific(dt_key, NULL);
if (result != ISC_R_SUCCESS) if (result != ISC_R_SUCCESS)
return (NULL); return (NULL);
@@ -440,7 +440,7 @@ dt_queue(dns_dtenv_t *env) {
ioq = malloc(sizeof(*ioq)); ioq = malloc(sizeof(*ioq));
if (ioq == NULL) if (ioq == NULL)
return (NULL); return (NULL);
ioq->ioqversion = ioqversion; ioq->generation = generation;
ioq->ioq = fstrm_iothr_get_input_queue(env->iothr); ioq->ioq = fstrm_iothr_get_input_queue(env->iothr);
if (ioq->ioq == NULL) { if (ioq->ioq == NULL) {
free(ioq); free(ioq);
@@ -484,7 +484,7 @@ destroy(dns_dtenv_t *env) {
"closing dnstap"); "closing dnstap");
env->magic = 0; env->magic = 0;
ioqversion++; generation++;
if (env->iothr != NULL) if (env->iothr != NULL)
fstrm_iothr_destroy(&env->iothr); fstrm_iothr_destroy(&env->iothr);