From: Mark Andrews Date: Tue, 20 Jan 2004 12:49:45 +0000 (+0000) Subject: save bucketnum so that we can unlock the lock after the fctx is destroyed. X-Git-Tag: v9.2.4rc1~81^2~23 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=78187348cacb2da811aedda3e296e970bc2b0426;p=thirdparty%2Fbind9.git save bucketnum so that we can unlock the lock after the fctx is destroyed. --- diff --git a/lib/dns/resolver.c b/lib/dns/resolver.c index 8863ff1e4a1..b758c8fc88c 100644 --- a/lib/dns/resolver.c +++ b/lib/dns/resolver.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: resolver.c,v 1.276 2004/01/14 02:06:50 marka Exp $ */ +/* $Id: resolver.c,v 1.277 2004/01/20 12:49:45 marka Exp $ */ #include @@ -4650,6 +4650,7 @@ resume_dslookup(isc_task_t *task, isc_event_t *event) { isc_result_t result; isc_boolean_t bucket_empty = ISC_FALSE; isc_boolean_t locked = ISC_FALSE; + unsigned int bucketnum; REQUIRE(event->ev_type == DNS_EVENT_FETCHDONE); fevent = (dns_fetchevent_t *)event; @@ -4667,6 +4668,7 @@ resume_dslookup(isc_task_t *task, isc_event_t *event) { dns_resolver_destroyfetch(&fctx->nsfetch); + bucketnum = fctx->bucketnum; if (fevent->result == ISC_R_CANCELED) fctx_done(fctx, ISC_R_CANCELED); else if (fevent->result == ISC_R_SUCCESS) { @@ -4713,7 +4715,7 @@ resume_dslookup(isc_task_t *task, isc_event_t *event) { if (result != ISC_R_SUCCESS) fctx_done(fctx, result); else { - LOCK(&res->buckets[fctx->bucketnum].lock); + LOCK(&res->buckets[bucketnum].lock); locked = ISC_TRUE; fctx->references++; } @@ -4725,11 +4727,11 @@ resume_dslookup(isc_task_t *task, isc_event_t *event) { INSIST(fevent->sigrdataset == NULL); isc_event_free(&event); if (!locked) - LOCK(&res->buckets[fctx->bucketnum].lock); + LOCK(&res->buckets[bucketnum].lock); fctx->references--; if (fctx->references == 0) bucket_empty = fctx_destroy(fctx); - UNLOCK(&res->buckets[fctx->bucketnum].lock); + UNLOCK(&res->buckets[bucketnum].lock); if (bucket_empty) empty_bucket(res); }