- Make isc_mutex_destroy return void 1049/head
authorWitold Kręcicki <wpk@isc.org>
Mon, 19 Nov 2018 10:31:09 +0000 (10:31 +0000)
committerWitold Kręcicki <wpk@isc.org>
Thu, 22 Nov 2018 11:52:08 +0000 (11:52 +0000)
- Make isc_mutexblock_init/destroy return void
- Minor cleanups

58 files changed:
bin/dig/dighost.c
bin/dnssec/dnssec-signzone.c
bin/named/statschannel.c
bin/named/unix/dlz_dlopen_driver.c
bin/named/win32/dlz_dlopen_driver.c
bin/tests/optional/mempool_test.c
bin/tests/optional/sig0_test.c
lib/dns/adb.c
lib/dns/badcache.c
lib/dns/byaddr.c
lib/dns/cache.c
lib/dns/catz.c
lib/dns/client.c
lib/dns/dbtable.c
lib/dns/dispatch.c
lib/dns/dnsrps.c
lib/dns/ecdb.c
lib/dns/lookup.c
lib/dns/master.c
lib/dns/masterdump.c
lib/dns/openssl_link.c
lib/dns/portlist.c
lib/dns/request.c
lib/dns/resolver.c
lib/dns/rpz.c
lib/dns/rrl.c
lib/dns/sdb.c
lib/dns/sdlz.c
lib/dns/ssu.c
lib/dns/stats.c
lib/dns/validator.c
lib/dns/view.c
lib/dns/zone.c
lib/irs/getaddrinfo.c
lib/isc/httpd.c
lib/isc/include/isc/mutexblock.h
lib/isc/include/isc/queue.h
lib/isc/include/isc/util.h
lib/isc/log.c
lib/isc/mem.c
lib/isc/mutexblock.c
lib/isc/pthreads/include/isc/mutex.h
lib/isc/quota.c
lib/isc/ratelimiter.c
lib/isc/rwlock.c
lib/isc/stats.c
lib/isc/task.c
lib/isc/tests/timer_test.c
lib/isc/timer.c
lib/isc/unix/app.c
lib/isc/unix/socket.c
lib/isc/win32/app.c
lib/isc/win32/include/isc/mutex.h
lib/isc/win32/socket.c
lib/ns/client.c
lib/ns/interfacemgr.c
lib/ns/query.c
lib/ns/stats.c

index c362ba5..2b6cab5 100644 (file)
@@ -4198,7 +4198,7 @@ destroy_libs(void) {
        }
 
        UNLOCK_LOOKUP;
-       DESTROYLOCK(&lookup_lock);
+       isc_mutex_destroy(&lookup_lock);
        debug("Removing log context");
        isc_log_destroy(&lctx);
 
index d542390..7e2e6c6 100644 (file)
@@ -3936,9 +3936,9 @@ main(int argc, char *argv[]) {
                check_result(result, "dns_master_dumptostream3");
        }
 
-       DESTROYLOCK(&namelock);
+       isc_mutex_destroy(&namelock);
        if (printstats)
-               DESTROYLOCK(&statslock);
+               isc_mutex_destroy(&statslock);
 
        if (!output_stdout) {
                result = isc_stdio_close(outfp);
index 7e023f0..4566a6f 100644 (file)
@@ -3226,7 +3226,7 @@ destroy_listener(void *arg) {
        /* We don't have to acquire the lock here since it's already unlinked */
        dns_acl_detach(&listener->acl);
 
-       DESTROYLOCK(&listener->lock);
+       isc_mutex_destroy(&listener->lock);
        isc_mem_putanddetach(&listener->mctx, listener, sizeof(*listener));
 }
 
@@ -3348,7 +3348,7 @@ cleanup:
        if (result != ISC_R_SUCCESS) {
                if (listener->acl != NULL)
                        dns_acl_detach(&listener->acl);
-               DESTROYLOCK(&listener->lock);
+               isc_mutex_destroy(&listener->lock);
                isc_mem_putanddetach(&listener->mctx, listener,
                                     sizeof(*listener));
        }
index 61602f3..8f540ed 100644 (file)
@@ -362,15 +362,19 @@ dlopen_dlz_create(const char *dlzname, unsigned int argc, char *argv[],
 
 failed:
        dlopen_log(ISC_LOG_ERROR, "dlz_dlopen of '%s' failed", dlzname);
-       if (cd->dl_path != NULL)
+       if (cd->dl_path != NULL) {
                isc_mem_free(mctx, cd->dl_path);
-       if (cd->dlzname != NULL)
+       }
+       if (cd->dlzname != NULL) {
                isc_mem_free(mctx, cd->dlzname);
-       if (dlopen_flags != 0)
-               (void) isc_mutex_destroy(&cd->lock);
+       }
+       if (dlopen_flags != 0) {
+               isc_mutex_destroy(&cd->lock);
+       }
 #ifdef HAVE_DLCLOSE
-       if (cd->dl_handle)
+       if (cd->dl_handle) {
                dlclose(cd->dl_handle);
+       }
 #endif
        isc_mem_put(mctx, cd, sizeof(*cd));
        isc_mem_destroy(&mctx);
@@ -393,17 +397,20 @@ dlopen_dlz_destroy(void *driverarg, void *dbdata) {
                MAYBE_UNLOCK(cd);
        }
 
-       if (cd->dl_path)
+       if (cd->dl_path) {
                isc_mem_free(cd->mctx, cd->dl_path);
-       if (cd->dlzname)
+       }
+       if (cd->dlzname) {
                isc_mem_free(cd->mctx, cd->dlzname);
+       }
 
 #ifdef HAVE_DLCLOSE
-       if (cd->dl_handle)
+       if (cd->dl_handle) {
                dlclose(cd->dl_handle);
+       }
 #endif
 
-       (void) isc_mutex_destroy(&cd->lock);
+       isc_mutex_destroy(&cd->lock);
 
        mctx = cd->mctx;
        isc_mem_put(mctx, cd, sizeof(*cd));
index 650f56a..350773b 100644 (file)
@@ -347,17 +347,21 @@ dlopen_dlz_create(const char *dlzname, unsigned int argc, char *argv[],
        return (ISC_R_SUCCESS);
 
 cleanup_lock:
-       DESTROYLOCK(&cd->lock);
+       isc_mutex_destroy(&cd->lock);
 failed:
        dlopen_log(ISC_LOG_ERROR, "dlz_dlopen of '%s' failed", dlzname);
-       if (cd->dl_path)
+       if (cd->dl_path) {
                isc_mem_free(mctx, cd->dl_path);
-       if (cd->dlzname)
+       }
+       if (cd->dlzname) {
                isc_mem_free(mctx, cd->dlzname);
-       if (triedload)
-               (void) isc_mutex_destroy(&cd->lock);
-       if (cd->dl_handle)
+       }
+       if (triedload) {
+               isc_mutex_destroy(&cd->lock);
+       }
+       if (cd->dl_handle) {
                FreeLibrary(cd->dl_handle);
+       }
        isc_mem_put(mctx, cd, sizeof(*cd));
        isc_mem_destroy(&mctx);
        return (result);
@@ -388,7 +392,7 @@ dlopen_dlz_destroy(void *driverarg, void *dbdata) {
        if (cd->dl_handle)
                FreeLibrary(cd->dl_handle);
 
-       DESTROYLOCK(&cd->lock);
+       isc_mutex_destroy(&cd->lock);
 
        mctx = cd->mctx;
        isc_mem_put(mctx, cd, sizeof(*cd));
index f696ce0..dc8b3b8 100644 (file)
@@ -114,7 +114,7 @@ main(int argc, char *argv[]) {
 
        isc_mem_destroy(&mctx);
 
-       DESTROYLOCK(&lock);
+       isc_mutex_destroy(&lock);
 
        return (0);
 }
index 3416f35..9db47c6 100644 (file)
@@ -282,7 +282,7 @@ main(int argc, char *argv[]) {
                isc_mem_stats(mctx, stdout);
        isc_mem_destroy(&mctx);
 
-       DESTROYLOCK(&lock);
+       isc_mutex_destroy(&lock);
 
        isc_app_finish();
 
index 3e5bab9..ac0ab18 100644 (file)
@@ -610,9 +610,7 @@ grow_entries(isc_task_t *task, isc_event_t *ev) {
        /*
         * Initialise the new resources.
         */
-       result = isc_mutexblock_init(newentrylocks, n);
-       if (result != ISC_R_SUCCESS)
-               goto cleanup;
+       isc_mutexblock_init(newentrylocks, n);
 
        for (i = 0; i < n; i++) {
                ISC_LIST_INIT(newentries[i]);
@@ -655,7 +653,7 @@ grow_entries(isc_task_t *task, isc_event_t *ev) {
        /*
         * Cleanup old resources.
         */
-       DESTROYMUTEXBLOCK(adb->entrylocks, adb->nentries);
+       isc_mutexblock_destroy(adb->entrylocks, adb->nentries);
        isc_mem_put(adb->mctx, adb->entries,
                    sizeof(*adb->entries) * adb->nentries);
        isc_mem_put(adb->mctx, adb->deadentries,
@@ -767,9 +765,7 @@ grow_names(isc_task_t *task, isc_event_t *ev) {
        /*
         * Initialise the new resources.
         */
-       result = isc_mutexblock_init(newnamelocks, n);
-       if (result != ISC_R_SUCCESS)
-               goto cleanup;
+       isc_mutexblock_init(newnamelocks, n);
 
        for (i = 0; i < n; i++) {
                ISC_LIST_INIT(newnames[i]);
@@ -812,7 +808,7 @@ grow_names(isc_task_t *task, isc_event_t *ev) {
        /*
         * Cleanup old resources.
         */
-       DESTROYMUTEXBLOCK(adb->namelocks, adb->nnames);
+       isc_mutexblock_destroy(adb->namelocks, adb->nnames);
        isc_mem_put(adb->mctx, adb->names,
                    sizeof(*adb->names) * adb->nnames);
        isc_mem_put(adb->mctx, adb->deadnames,
@@ -1979,7 +1975,7 @@ free_adbfind(dns_adb_t *adb, dns_adbfind_t **findp) {
 
        find->magic = 0;
 
-       DESTROYLOCK(&find->lock);
+       isc_mutex_destroy(&find->lock);
        isc_mempool_put(adb->ahmp, find);
        return (dec_adb_irefcnt(adb));
 }
@@ -2475,7 +2471,7 @@ destroy(dns_adb_t *adb) {
        isc_mempool_destroy(&adb->aimp);
        isc_mempool_destroy(&adb->afmp);
 
-       DESTROYMUTEXBLOCK(adb->entrylocks, adb->nentries);
+       isc_mutexblock_destroy(adb->entrylocks, adb->nentries);
        isc_mem_put(adb->mctx, adb->entries,
                    sizeof(*adb->entries) * adb->nentries);
        isc_mem_put(adb->mctx, adb->deadentries,
@@ -2487,7 +2483,7 @@ destroy(dns_adb_t *adb) {
        isc_mem_put(adb->mctx, adb->entry_refcnt,
                    sizeof(*adb->entry_refcnt) * adb->nentries);
 
-       DESTROYMUTEXBLOCK(adb->namelocks, adb->nnames);
+       isc_mutexblock_destroy(adb->namelocks, adb->nnames);
        isc_mem_put(adb->mctx, adb->names,
                    sizeof(*adb->names) * adb->nnames);
        isc_mem_put(adb->mctx, adb->deadnames,
@@ -2499,12 +2495,12 @@ destroy(dns_adb_t *adb) {
        isc_mem_put(adb->mctx, adb->name_refcnt,
                    sizeof(*adb->name_refcnt) * adb->nnames);
 
-       DESTROYLOCK(&adb->reflock);
-       DESTROYLOCK(&adb->lock);
-       DESTROYLOCK(&adb->mplock);
-       DESTROYLOCK(&adb->overmemlock);
-       DESTROYLOCK(&adb->entriescntlock);
-       DESTROYLOCK(&adb->namescntlock);
+       isc_mutex_destroy(&adb->reflock);
+       isc_mutex_destroy(&adb->lock);
+       isc_mutex_destroy(&adb->mplock);
+       isc_mutex_destroy(&adb->overmemlock);
+       isc_mutex_destroy(&adb->entriescntlock);
+       isc_mutex_destroy(&adb->namescntlock);
 
        isc_mem_putanddetach(&adb->mctx, adb, sizeof(dns_adb_t));
 }
@@ -2644,9 +2640,8 @@ dns_adb_create(isc_mem_t *mem, dns_view_t *view, isc_timermgr_t *timermgr,
         * Initialize the bucket locks for names and elements.
         * May as well initialize the list heads, too.
         */
-       result = isc_mutexblock_init(adb->namelocks, adb->nnames);
-       if (result != ISC_R_SUCCESS)
-               goto fail1;
+       isc_mutexblock_init(adb->namelocks, adb->nnames);
+
        for (i = 0; i < adb->nnames; i++) {
                ISC_LIST_INIT(adb->names[i]);
                ISC_LIST_INIT(adb->deadnames[i]);
@@ -2661,9 +2656,7 @@ dns_adb_create(isc_mem_t *mem, dns_view_t *view, isc_timermgr_t *timermgr,
                adb->entry_refcnt[i] = 0;
                adb->irefcnt++;
        }
-       result = isc_mutexblock_init(adb->entrylocks, adb->nentries);
-       if (result != ISC_R_SUCCESS)
-               goto fail2;
+       isc_mutexblock_init(adb->entrylocks, adb->nentries);
 
        /*
         * Memory pools
@@ -2671,12 +2664,12 @@ dns_adb_create(isc_mem_t *mem, dns_view_t *view, isc_timermgr_t *timermgr,
 #define MPINIT(t, p, n) do { \
        result = isc_mempool_create(mem, sizeof(t), &(p)); \
        if (result != ISC_R_SUCCESS) \
-               goto fail3; \
+               goto fail2; \
        isc_mempool_setfreemax((p), FREE_ITEMS); \
        isc_mempool_setfillcount((p), FILL_COUNT); \
        isc_mempool_setname((p), n); \
        isc_mempool_associatelock((p), &adb->mplock); \
-} while (0)
+       } while (0)
 
        MPINIT(dns_adbname_t, adb->nmp, "adbname");
        MPINIT(dns_adbnamehook_t, adb->nhmp, "adbnamehook");
@@ -2693,13 +2686,13 @@ dns_adb_create(isc_mem_t *mem, dns_view_t *view, isc_timermgr_t *timermgr,
         */
        result = isc_task_create(adb->taskmgr, 0, &adb->task);
        if (result != ISC_R_SUCCESS)
-               goto fail3;
+               goto fail2;
 
        isc_task_setname(adb->task, "ADB", adb);
 
        result = isc_stats_create(adb->mctx, &view->adbstats, dns_adbstats_max);
        if (result != ISC_R_SUCCESS)
-               goto fail3;
+               goto fail2;
 
        set_adbstat(adb, adb->nentries, dns_adbstats_nentries);
        set_adbstat(adb, adb->nnames, dns_adbstats_nnames);
@@ -2711,15 +2704,13 @@ dns_adb_create(isc_mem_t *mem, dns_view_t *view, isc_timermgr_t *timermgr,
        *newadb = adb;
        return (ISC_R_SUCCESS);
 
- fail3:
+ fail2:
        if (adb->task != NULL)
                isc_task_detach(&adb->task);
 
        /* clean up entrylocks */
-       DESTROYMUTEXBLOCK(adb->entrylocks, adb->nentries);
-
- fail2: /* clean up namelocks */
-       DESTROYMUTEXBLOCK(adb->namelocks, adb->nnames);
+       isc_mutexblock_destroy(adb->entrylocks, adb->nentries);
+       isc_mutexblock_destroy(adb->namelocks, adb->nnames);
 
  fail1: /* clean up only allocated memory */
        if (adb->entries != NULL)
@@ -2767,12 +2758,12 @@ dns_adb_create(isc_mem_t *mem, dns_view_t *view, isc_timermgr_t *timermgr,
        if (adb->afmp != NULL)
                isc_mempool_destroy(&adb->afmp);
 
-       DESTROYLOCK(&adb->namescntlock);
-       DESTROYLOCK(&adb->entriescntlock);
-       DESTROYLOCK(&adb->overmemlock);
-       DESTROYLOCK(&adb->reflock);
-       DESTROYLOCK(&adb->mplock);
-       DESTROYLOCK(&adb->lock);
+       isc_mutex_destroy(&adb->namescntlock);
+       isc_mutex_destroy(&adb->entriescntlock);
+       isc_mutex_destroy(&adb->overmemlock);
+       isc_mutex_destroy(&adb->reflock);
+       isc_mutex_destroy(&adb->mplock);
+       isc_mutex_destroy(&adb->lock);
        if (adb->excl != NULL)
                isc_task_detach(&adb->excl);
        isc_mem_putanddetach(&adb->mctx, adb, sizeof(dns_adb_t));
index 3802f60..cea0f5d 100644 (file)
@@ -94,7 +94,7 @@ dns_badcache_init(isc_mem_t *mctx, unsigned int size, dns_badcache_t **bcp) {
        return (ISC_R_SUCCESS);
 
  destroy_lock:
-       DESTROYLOCK(&bc->lock);
+       isc_mutex_destroy(&bc->lock);
        isc_mem_putanddetach(&bc->mctx, bc, sizeof(dns_badcache_t));
        return (result);
 }
@@ -109,7 +109,7 @@ dns_badcache_destroy(dns_badcache_t **bcp) {
        dns_badcache_flush(bc);
 
        bc->magic = 0;
-       DESTROYLOCK(&bc->lock);
+       isc_mutex_destroy(&bc->lock);
        isc_mem_put(bc->mctx, bc->table, sizeof(dns_bcentry_t *) * bc->size);
        isc_mem_putanddetach(&bc->mctx, bc, sizeof(dns_badcache_t));
        *bcp = NULL;
index 63a5a9d..0ef75a3 100644 (file)
@@ -248,7 +248,7 @@ dns_byaddr_create(isc_mem_t *mctx, const isc_netaddr_t *address,
        return (ISC_R_SUCCESS);
 
  cleanup_lock:
-       DESTROYLOCK(&byaddr->lock);
+       isc_mutex_destroy(&byaddr->lock);
 
        ievent = (isc_event_t *)byaddr->event;
        isc_event_free(&ievent);
@@ -288,7 +288,7 @@ dns_byaddr_destroy(dns_byaddr_t **byaddrp) {
        REQUIRE(byaddr->task == NULL);
        dns_lookup_destroy(&byaddr->lookup);
 
-       DESTROYLOCK(&byaddr->lock);
+       isc_mutex_destroy(&byaddr->lock);
        byaddr->magic = 0;
        isc_mem_putanddetach(&byaddr->mctx, byaddr, sizeof(*byaddr));
 
index 7a0b514..1082d5f 100644 (file)
@@ -320,10 +320,10 @@ cleanup_dbargv:
 cleanup_dbtype:
        isc_mem_free(cmctx, cache->db_type);
 cleanup_filelock:
-       DESTROYLOCK(&cache->filelock);
+       isc_mutex_destroy(&cache->filelock);
 cleanup_stats:
        isc_stats_detach(&cache->stats);
-       DESTROYLOCK(&cache->lock);
+       isc_mutex_destroy(&cache->lock);
 cleanup_mem:
        if (cache->name != NULL) {
                isc_mem_free(cmctx, cache->name);
@@ -354,7 +354,7 @@ cache_free(dns_cache_t *cache) {
        if (cache->cleaner.iterator != NULL)
                dns_dbiterator_destroy(&cache->cleaner.iterator);
 
-       DESTROYLOCK(&cache->cleaner.lock);
+       isc_mutex_destroy(&cache->cleaner.lock);
 
        if (cache->filename) {
                isc_mem_free(cache->mctx, cache->filename);
@@ -388,8 +388,8 @@ cache_free(dns_cache_t *cache) {
        if (cache->stats != NULL)
                isc_stats_detach(&cache->stats);
 
-       DESTROYLOCK(&cache->lock);
-       DESTROYLOCK(&cache->filelock);
+       isc_mutex_destroy(&cache->lock);
+       isc_mutex_destroy(&cache->filelock);
 
        cache->magic = 0;
        isc_mem_detach(&cache->hmctx);
@@ -679,7 +679,7 @@ cache_cleaner_init(dns_cache_t *cache, isc_taskmgr_t *taskmgr,
                isc_task_detach(&cleaner->task);
        if (cleaner->iterator != NULL)
                dns_dbiterator_destroy(&cleaner->iterator);
-       DESTROYLOCK(&cleaner->lock);
+       isc_mutex_destroy(&cleaner->lock);
 
        return (result);
 }
index a0a653f..775e54c 100644 (file)
@@ -793,7 +793,7 @@ dns_catz_catzs_detach(dns_catz_zones_t **catzsp) {
 
        if (isc_refcount_decrement(&catzs->refs) == 1) {
                isc_task_destroy(&catzs->updater);
-               DESTROYLOCK(&catzs->lock);
+               isc_mutex_destroy(&catzs->lock);
                if (catzs->zones != NULL) {
                        isc_ht_iter_t *iter = NULL;
                        isc_result_t result;
index 0ab615b..f08dec7 100644 (file)
@@ -573,7 +573,7 @@ destroyclient(dns_client_t **clientp) {
                isc_appctx_destroy(&client->actx);
        }
 
-       DESTROYLOCK(&client->lock);
+       isc_mutex_destroy(&client->lock);
        client->magic = 0;
 
        isc_mem_putanddetach(&client->mctx, client, sizeof(*client));
@@ -1208,7 +1208,7 @@ resolve_done(isc_task_t *task, isc_event_t *event) {
                 * unexpected event).  Just clean the arg up.
                 */
                UNLOCK(&resarg->lock);
-               DESTROYLOCK(&resarg->lock);
+               isc_mutex_destroy(&resarg->lock);
                isc_mem_put(resarg->client->mctx, resarg, sizeof(*resarg));
        }
 }
@@ -1252,7 +1252,7 @@ dns_client_resolve(dns_client_t *client, const dns_name_t *name,
                                         client->task, resolve_done, resarg,
                                         &resarg->trans);
        if (result != ISC_R_SUCCESS) {
-               DESTROYLOCK(&resarg->lock);
+               isc_mutex_destroy(&resarg->lock);
                isc_mem_put(client->mctx, resarg, sizeof(*resarg));
                return (result);
        }
@@ -1288,7 +1288,7 @@ dns_client_resolve(dns_client_t *client, const dns_name_t *name,
        } else {
                UNLOCK(&resarg->lock);
 
-               DESTROYLOCK(&resarg->lock);
+               isc_mutex_destroy(&resarg->lock);
                isc_mem_put(client->mctx, resarg, sizeof(*resarg));
        }
 
@@ -1402,7 +1402,7 @@ dns_client_startresolve(dns_client_t *client, const dns_name_t *name,
        if (sigrdataset != NULL)
                putrdataset(client->mctx, &sigrdataset);
        if (rctx != NULL) {
-               DESTROYLOCK(&rctx->lock);
+               isc_mutex_destroy(&rctx->lock);
                isc_mem_put(mctx, rctx, sizeof(*rctx));
        }
        if (event != NULL)
@@ -1490,7 +1490,7 @@ dns_client_destroyrestrans(dns_clientrestrans_t **transp) {
 
        INSIST(ISC_LIST_EMPTY(rctx->namelist));
 
-       DESTROYLOCK(&rctx->lock);
+       isc_mutex_destroy(&rctx->lock);
        rctx->magic = 0;
 
        isc_mem_put(mctx, rctx, sizeof(*rctx));
@@ -1608,7 +1608,7 @@ localrequest_done(isc_task_t *task, isc_event_t *event) {
                 * unexpected event).  Just clean the arg up.
                 */
                UNLOCK(&reqarg->lock);
-               DESTROYLOCK(&reqarg->lock);
+               isc_mutex_destroy(&reqarg->lock);
                isc_mem_put(reqarg->client->mctx, reqarg, sizeof(*reqarg));
        }
 }
@@ -1656,7 +1656,7 @@ dns_client_request(dns_client_t *client, dns_message_t *qmessage,
                                         client->task, localrequest_done,
                                         reqarg, &reqarg->trans);
        if (result != ISC_R_SUCCESS) {
-               DESTROYLOCK(&reqarg->lock);
+               isc_mutex_destroy(&reqarg->lock);
                isc_mem_put(client->mctx, reqarg, sizeof(*reqarg));
                return (result);
        }
@@ -1684,7 +1684,7 @@ dns_client_request(dns_client_t *client, dns_message_t *qmessage,
        } else {
                UNLOCK(&reqarg->lock);
 
-               DESTROYLOCK(&reqarg->lock);
+               isc_mutex_destroy(&reqarg->lock);
                isc_mem_put(client->mctx, reqarg, sizeof(*reqarg));
        }
 
@@ -1783,7 +1783,7 @@ dns_client_startrequest(dns_client_t *client, dns_message_t *qmessage,
                LOCK(&client->lock);
                ISC_LIST_UNLINK(client->reqctxs, ctx, link);
                UNLOCK(&client->lock);
-               DESTROYLOCK(&ctx->lock);
+               isc_mutex_destroy(&ctx->lock);
                isc_mem_put(client->mctx, ctx, sizeof(*ctx));
        }
        if (event != NULL)
@@ -1844,7 +1844,7 @@ dns_client_destroyreqtrans(dns_clientreqtrans_t **transp) {
 
        UNLOCK(&client->lock);
 
-       DESTROYLOCK(&ctx->lock);
+       isc_mutex_destroy(&ctx->lock);
        ctx->magic = 0;
 
        isc_mem_put(mctx, ctx, sizeof(*ctx));
@@ -2662,7 +2662,7 @@ internal_update_callback(isc_task_t *task, isc_event_t *event) {
                 * unexpected event).  Just clean the arg up.
                 */
                UNLOCK(&uarg->lock);
-               DESTROYLOCK(&uarg->lock);
+               isc_mutex_destroy(&uarg->lock);
                isc_mem_put(uarg->client->mctx, uarg, sizeof(*uarg));
        }
 }
@@ -2708,7 +2708,7 @@ dns_client_update(dns_client_t *client, dns_rdataclass_t rdclass,
                                        internal_update_callback, uarg,
                                        &uarg->trans);
        if (result != ISC_R_SUCCESS) {
-               DESTROYLOCK(&uarg->lock);
+               isc_mutex_destroy(&uarg->lock);
                isc_mem_put(client->mctx, uarg, sizeof(*uarg));
                return (result);
        }
@@ -2737,7 +2737,7 @@ dns_client_update(dns_client_t *client, dns_rdataclass_t rdclass,
        } else {
                UNLOCK(&uarg->lock);
 
-               DESTROYLOCK(&uarg->lock);
+               isc_mutex_destroy(&uarg->lock);
                isc_mem_put(client->mctx, uarg, sizeof(*uarg));
        }
 
@@ -2975,7 +2975,7 @@ dns_client_startupdate(dns_client_t *client, dns_rdataclass_t rdclass,
        if (uctx->tsigkey != NULL)
                dns_tsigkey_detach(&uctx->tsigkey);
        isc_task_detach(&tclone);
-       DESTROYLOCK(&uctx->lock);
+       isc_mutex_destroy(&uctx->lock);
        uctx->magic = 0;
        isc_mem_put(client->mctx, uctx, sizeof(*uctx));
        dns_view_detach(&view);
@@ -3045,7 +3045,7 @@ dns_client_destroyupdatetrans(dns_clientupdatetrans_t **transp) {
 
        UNLOCK(&client->lock);
 
-       DESTROYLOCK(&uctx->lock);
+       isc_mutex_destroy(&uctx->lock);
        uctx->magic = 0;
 
        isc_mem_put(mctx, uctx, sizeof(*uctx));
index 934baac..24358b2 100644 (file)
@@ -85,7 +85,7 @@ dns_dbtable_create(isc_mem_t *mctx, dns_rdataclass_t rdclass,
        return (ISC_R_SUCCESS);
 
  clean3:
-       DESTROYLOCK(&dbtable->lock);
+       isc_mutex_destroy(&dbtable->lock);
 
        dns_rbt_destroy(&dbtable->rbt);
 
index 969153d..874415d 100644 (file)
@@ -526,7 +526,7 @@ destroy_disp(isc_task_t *task, isc_event_t *event) {
 
        if (disp->sepool != NULL) {
                isc_mempool_destroy(&disp->sepool);
-               (void)isc_mutex_destroy(&disp->sepool_lock);
+               isc_mutex_destroy(&disp->sepool_lock);
        }
 
        if (disp->socket != NULL)
@@ -1625,7 +1625,7 @@ destroy_mgr(dns_dispatchmgr_t **mgrp) {
 
        mgr->magic = 0;
        mgr->mctx = NULL;
-       DESTROYLOCK(&mgr->lock);
+       isc_mutex_destroy(&mgr->lock);
        mgr->state = 0;
 
        isc_mempool_destroy(&mgr->depool);
@@ -1636,16 +1636,16 @@ destroy_mgr(dns_dispatchmgr_t **mgrp) {
        if (mgr->spool != NULL)
                isc_mempool_destroy(&mgr->spool);
 
-       DESTROYLOCK(&mgr->spool_lock);
-       DESTROYLOCK(&mgr->bpool_lock);
-       DESTROYLOCK(&mgr->dpool_lock);
-       DESTROYLOCK(&mgr->rpool_lock);
-       DESTROYLOCK(&mgr->depool_lock);
+       isc_mutex_destroy(&mgr->spool_lock);
+       isc_mutex_destroy(&mgr->bpool_lock);
+       isc_mutex_destroy(&mgr->dpool_lock);
+       isc_mutex_destroy(&mgr->rpool_lock);
+       isc_mutex_destroy(&mgr->depool_lock);
 
        if (mgr->qid != NULL)
                qid_destroy(mctx, &mgr->qid);
 
-       DESTROYLOCK(&mgr->buffer_lock);
+       isc_mutex_destroy(&mgr->buffer_lock);
 
        if (mgr->blackhole != NULL)
                dns_acl_detach(&mgr->blackhole);
@@ -1772,7 +1772,7 @@ dns_dispatchmgr_create(isc_mem_t *mctx, dns_dispatchmgr_t **mgrp)
        if (isc_mempool_create(mgr->mctx, sizeof(dns_dispatchevent_t),
                               &mgr->depool) != ISC_R_SUCCESS) {
                result = ISC_R_NOMEMORY;
-               goto kill_spool_lock;
+               goto kill_locks;
        }
 
        mgr->rpool = NULL;
@@ -1846,14 +1846,14 @@ dns_dispatchmgr_create(isc_mem_t *mctx, dns_dispatchmgr_t **mgrp)
        isc_mempool_destroy(&mgr->rpool);
  kill_depool:
        isc_mempool_destroy(&mgr->depool);
- kill_spool_lock:
-       DESTROYLOCK(&mgr->spool_lock);
-       DESTROYLOCK(&mgr->bpool_lock);
-       DESTROYLOCK(&mgr->dpool_lock);
-       DESTROYLOCK(&mgr->rpool_lock);
-       DESTROYLOCK(&mgr->depool_lock);
-       DESTROYLOCK(&mgr->buffer_lock);
-       DESTROYLOCK(&mgr->lock);
+ kill_locks:
+       isc_mutex_destroy(&mgr->spool_lock);
+       isc_mutex_destroy(&mgr->bpool_lock);
+       isc_mutex_destroy(&mgr->dpool_lock);
+       isc_mutex_destroy(&mgr->rpool_lock);
+       isc_mutex_destroy(&mgr->depool_lock);
+       isc_mutex_destroy(&mgr->buffer_lock);
+       isc_mutex_destroy(&mgr->lock);
        isc_mem_put(mctx, mgr, sizeof(dns_dispatchmgr_t));
        isc_mem_detach(&mctx);
 
@@ -2296,7 +2296,7 @@ qid_destroy(isc_mem_t *mctx, dns_qid_t **qidp) {
                isc_mem_put(mctx, qid->sock_table,
                            qid->qid_nbuckets * sizeof(dispsocketlist_t));
        }
-       DESTROYLOCK(&qid->lock);
+       isc_mutex_destroy(&qid->lock);
        isc_mem_put(mctx, qid, sizeof(*qid));
 }
 
@@ -2364,7 +2364,7 @@ dispatch_allocate(dns_dispatchmgr_t *mgr, unsigned int maxrequests,
         * error returns
         */
  kill_lock:
-       DESTROYLOCK(&disp->lock);
+       isc_mutex_destroy(&disp->lock);
        isc_mempool_put(mgr->dpool, disp);
 
        return (result);
@@ -2416,7 +2416,7 @@ dispatch_free(dns_dispatch_t **dispp) {
                isc_mempool_destroy(&disp->portpool);
 
        disp->mgr = NULL;
-       DESTROYLOCK(&disp->lock);
+       isc_mutex_destroy(&disp->lock);
        disp->magic = 0;
        isc_mempool_put(mgr->dpool, disp);
 }
@@ -3689,7 +3689,7 @@ dns_dispatchset_create(isc_mem_t *mctx, isc_socketmgr_t *sockmgr,
                isc_mem_detach(&dset->mctx);
 
  fail_lock:
-       DESTROYLOCK(&dset->lock);
+       isc_mutex_destroy(&dset->lock);
        isc_mem_put(mctx, dset, sizeof(dns_dispatchset_t));
        return (result);
 }
@@ -3719,7 +3719,7 @@ dns_dispatchset_destroy(dns_dispatchset_t **dsetp) {
                dns_dispatch_detach(&(dset->dispatches[i]));
        isc_mem_put(dset->mctx, dset->dispatches,
                    sizeof(dns_dispatch_t *) * dset->ndisp);
-       DESTROYLOCK(&dset->lock);
+       isc_mutex_destroy(&dset->lock);
        isc_mem_putanddetach(&dset->mctx, dset, sizeof(dns_dispatchset_t));
 
        *dsetp = NULL;
index f2027fb..784a055 100644 (file)
@@ -77,7 +77,7 @@ static void
 dnsrps_mutex_destroy(void *mutex0) {
        isc_mutex_t *mutex = mutex0;
 
-       DESTROYLOCK(mutex);
+       isc_mutex_destroy(mutex);
 }
 
 static void
index cdf1a8e..10e0dfe 100644 (file)
@@ -173,7 +173,7 @@ destroy_ecdb(dns_ecdb_t **ecdbp) {
        if (dns_name_dynamic(&ecdb->common.origin))
                dns_name_free(&ecdb->common.origin, mctx);
 
-       DESTROYLOCK(&ecdb->lock);
+       isc_mutex_destroy(&ecdb->lock);
 
        ecdb->common.impmagic = 0;
        ecdb->common.magic = 0;
@@ -249,7 +249,7 @@ destroynode(dns_ecdbnode_t *node) {
                isc_mem_put(mctx, header, headersize);
        }
 
-       DESTROYLOCK(&node->lock);
+       isc_mutex_destroy(&node->lock);
 
        node->magic = 0;
        isc_mem_put(mctx, node, sizeof(*node));
@@ -359,7 +359,7 @@ findnode(dns_db_t *db, const dns_name_t *name, bool create,
        dns_name_init(&node->name, NULL);
        result = dns_name_dup(name, mctx, &node->name);
        if (result != ISC_R_SUCCESS) {
-               DESTROYLOCK(&node->lock);
+               isc_mutex_destroy(&node->lock);
                isc_mem_put(mctx, node, sizeof(*node));
                return (result);
        }
index ecf9c8d..af00365 100644 (file)
@@ -435,7 +435,7 @@ dns_lookup_create(isc_mem_t *mctx, const dns_name_t *name, dns_rdatatype_t type,
        return (ISC_R_SUCCESS);
 
  cleanup_lock:
-       DESTROYLOCK(&lookup->lock);
+       isc_mutex_destroy(&lookup->lock);
        ievent = (isc_event_t *)lookup->event;
        isc_event_free(&ievent);
        lookup->event = NULL;
@@ -480,7 +480,7 @@ dns_lookup_destroy(dns_lookup_t **lookupp) {
        if (dns_rdataset_isassociated(&lookup->sigrdataset))
                dns_rdataset_disassociate(&lookup->sigrdataset);
 
-       DESTROYLOCK(&lookup->lock);
+       isc_mutex_destroy(&lookup->lock);
        lookup->magic = 0;
        isc_mem_putanddetach(&lookup->mctx, lookup, sizeof(*lookup));
 
index ac4c137..4002dbc 100644 (file)
@@ -463,7 +463,7 @@ loadctx_destroy(dns_loadctx_t *lctx) {
 
        if (lctx->task != NULL)
                isc_task_detach(&lctx->task);
-       DESTROYLOCK(&lctx->lock);
+       isc_mutex_destroy(&lctx->lock);
        mctx = NULL;
        isc_mem_attach(lctx->mctx, &mctx);
        isc_mem_detach(&lctx->mctx);
index 109bffd..1eff6f5 100644 (file)
@@ -1266,7 +1266,7 @@ static void
 dumpctx_destroy(dns_dumpctx_t *dctx) {
 
        dctx->magic = 0;
-       DESTROYLOCK(&dctx->lock);
+       isc_mutex_destroy(&dctx->lock);
        dns_dbiterator_destroy(&dctx->dbiter);
        if (dctx->version != NULL)
                dns_db_closeversion(dctx->db, &dctx->version, false);
index 8781406..e1fa797 100644 (file)
@@ -117,9 +117,7 @@ dst__openssl_init(isc_mem_t *mctx, const char *engine) {
        locks = isc_mem_allocate(dst__mctx, sizeof(isc_mutex_t) * nlocks);
        if (locks == NULL)
                return (ISC_R_NOMEMORY);
-       result = isc_mutexblock_init(locks, nlocks);
-       if (result != ISC_R_SUCCESS)
-               goto cleanup_mutexalloc;
+       isc_mutexblock_init(locks, nlocks);
        CRYPTO_set_locking_callback(lock_callback);
 # if defined(LIBRESSL_VERSION_NUMBER)
        CRYPTO_set_id_callback(id_callback);
@@ -181,8 +179,7 @@ dst__openssl_init(isc_mem_t *mctx, const char *engine) {
 #endif
 #if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
        CRYPTO_set_locking_callback(NULL);
-       DESTROYMUTEXBLOCK(locks, nlocks);
- cleanup_mutexalloc:
+       isc_mutexblock_destroy(locks, nlocks);
        isc_mem_free(dst__mctx, locks);
        locks = NULL;
 #endif
@@ -219,7 +216,7 @@ dst__openssl_destroy(void) {
 
        if (locks != NULL) {
                CRYPTO_set_locking_callback(NULL);
-               DESTROYMUTEXBLOCK(locks, nlocks);
+               isc_mutexblock_destroy(locks, nlocks);
                isc_mem_free(dst__mctx, locks);
                locks = NULL;
        }
index 882058d..26bfc79 100644 (file)
@@ -240,7 +240,7 @@ dns_portlist_detach(dns_portlist_t **portlistp) {
                        isc_mem_put(portlist->mctx, portlist->list,
                                    portlist->allocated *
                                    sizeof(*portlist->list));
-               DESTROYLOCK(&portlist->lock);
+               isc_mutex_destroy(&portlist->lock);
                isc_mem_putanddetach(&portlist->mctx, portlist,
                                     sizeof(*portlist));
        }
index df19ebc..728744c 100644 (file)
@@ -385,9 +385,9 @@ mgr_destroy(dns_requestmgr_t *requestmgr) {
        REQUIRE(requestmgr->eref == 0);
        REQUIRE(requestmgr->iref == 0);
 
-       DESTROYLOCK(&requestmgr->lock);
+       isc_mutex_destroy(&requestmgr->lock);
        for (i = 0; i < DNS_REQUEST_NLOCKS; i++)
-               DESTROYLOCK(&requestmgr->locks[i]);
+               isc_mutex_destroy(&requestmgr->locks[i]);
        if (requestmgr->dispatchv4 != NULL)
                dns_dispatch_detach(&requestmgr->dispatchv4);
        if (requestmgr->dispatchv6 != NULL)
index 1d25f44..bfb58f1 100644 (file)
@@ -9732,14 +9732,14 @@ destroy(dns_resolver_t *res) {
 
        INSIST(res->nfctx == 0);
 
-       DESTROYLOCK(&res->primelock);
-       DESTROYLOCK(&res->nlock);
-       DESTROYLOCK(&res->lock);
+       isc_mutex_destroy(&res->primelock);
+       isc_mutex_destroy(&res->nlock);
+       isc_mutex_destroy(&res->lock);
        for (i = 0; i < res->nbuckets; i++) {
                INSIST(ISC_LIST_EMPTY(res->buckets[i].fctxs));
                isc_task_shutdown(res->buckets[i].task);
                isc_task_detach(&res->buckets[i].task);
-               DESTROYLOCK(&res->buckets[i].lock);
+               isc_mutex_destroy(&res->buckets[i].lock);
                isc_mem_detach(&res->buckets[i].mctx);
        }
        isc_mem_put(res->mctx, res->buckets,
@@ -9747,7 +9747,7 @@ destroy(dns_resolver_t *res) {
        for (i = 0; i < RES_DOMAIN_BUCKETS; i++) {
                INSIST(ISC_LIST_EMPTY(res->dbuckets[i].list));
                isc_mem_detach(&res->dbuckets[i].mctx);
-               DESTROYLOCK(&res->dbuckets[i].lock);
+               isc_mutex_destroy(&res->dbuckets[i].lock);
        }
        isc_mem_put(res->mctx, res->dbuckets,
                    RES_DOMAIN_BUCKETS * sizeof(zonebucket_t));
@@ -9926,7 +9926,7 @@ dns_resolver_create(dns_view_t *view,
                res->buckets[i].task = NULL;
                result = isc_task_create(taskmgr, 0, &res->buckets[i].task);
                if (result != ISC_R_SUCCESS) {
-                       DESTROYLOCK(&res->buckets[i].lock);
+                       isc_mutex_destroy(&res->buckets[i].lock);
                        goto cleanup_buckets;
                }
                res->buckets[i].mctx = NULL;
@@ -9939,7 +9939,7 @@ dns_resolver_create(dns_view_t *view,
                result = isc_mem_create(0, 0, &res->buckets[i].mctx);
                if (result != ISC_R_SUCCESS) {
                        isc_task_detach(&res->buckets[i].task);
-                       DESTROYLOCK(&res->buckets[i].lock);
+                       isc_mutex_destroy(&res->buckets[i].lock);
                        goto cleanup_buckets;
                }
                isc_mem_setname(res->buckets[i].mctx, name, NULL);
@@ -10038,9 +10038,9 @@ dns_resolver_create(dns_view_t *view,
 #endif
 
  cleanup_primelock:
-       DESTROYLOCK(&res->primelock);
-       DESTROYLOCK(&res->nlock);
-       DESTROYLOCK(&res->lock);
+       isc_mutex_destroy(&res->primelock);
+       isc_mutex_destroy(&res->nlock);
+       isc_mutex_destroy(&res->lock);
 
        if (res->dispatches6 != NULL)
                dns_dispatchset_destroy(&res->dispatches6);
@@ -10048,7 +10048,7 @@ dns_resolver_create(dns_view_t *view,
                dns_dispatchset_destroy(&res->dispatches4);
 
        for (i = 0; i < dbuckets_created; i++) {
-               DESTROYLOCK(&res->dbuckets[i].lock);
+               isc_mutex_destroy(&res->dbuckets[i].lock);
                isc_mem_detach(&res->dbuckets[i].mctx);
        }
        isc_mem_put(view->mctx, res->dbuckets,
@@ -10057,7 +10057,7 @@ dns_resolver_create(dns_view_t *view,
  cleanup_buckets:
        for (i = 0; i < buckets_created; i++) {
                isc_mem_detach(&res->buckets[i].mctx);
-               DESTROYLOCK(&res->buckets[i].lock);
+               isc_mutex_destroy(&res->buckets[i].lock);
                isc_task_shutdown(res->buckets[i].task);
                isc_task_detach(&res->buckets[i].task);
        }
index 09b71ba..0d75ff0 100644 (file)
@@ -1485,7 +1485,7 @@ cleanup_rbt:
        INSIST(isc_refcount_decrement(&zones->refs) > 0);
        isc_refcount_destroy(&zones->refs);
 
-       DESTROYLOCK(&zones->maint_lock);
+       isc_mutex_destroy(&zones->maint_lock);
 
        isc_rwlock_destroy(&zones->search_lock);
 
@@ -2177,7 +2177,7 @@ dns_rpz_detach_rpzs(dns_rpz_zones_t **rpzsp) {
                if (rpzs->rbt != NULL) {
                        dns_rbt_destroy(&rpzs->rbt);
                }
-               DESTROYLOCK(&rpzs->maint_lock);
+               isc_mutex_destroy(&rpzs->maint_lock);
                isc_rwlock_destroy(&rpzs->search_lock);
                isc_refcount_destroy(&rpzs->refs);
                isc_mem_putanddetach(&rpzs->mctx, rpzs, sizeof(*rpzs));
index 9a15bc8..b603a98 100644 (file)
@@ -1263,7 +1263,7 @@ dns_rrl_view_destroy(dns_view_t *view) {
        if (rrl->exempt != NULL)
                dns_acl_detach(&rrl->exempt);
 
-       DESTROYLOCK(&rrl->lock);
+       isc_mutex_destroy(&rrl->lock);
 
        while (!ISC_LIST_EMPTY(rrl->blocks)) {
                b = ISC_LIST_HEAD(rrl->blocks);
index fcde0e0..c319dbd 100644 (file)
@@ -238,7 +238,7 @@ dns_sdb_register(const char *drivername, const dns_sdbmethods_t *methods,
        return (ISC_R_SUCCESS);
 
  cleanup_mutex:
-       DESTROYLOCK(&imp->driverlock);
+       isc_mutex_destroy(&imp->driverlock);
        isc_mem_put(mctx, imp, sizeof(dns_sdbimplementation_t));
        return (result);
 }
@@ -252,7 +252,7 @@ dns_sdb_unregister(dns_sdbimplementation_t **sdbimp) {
 
        imp = *sdbimp;
        dns_db_unregister(&imp->dbimp);
-       DESTROYLOCK(&imp->driverlock);
+       isc_mutex_destroy(&imp->driverlock);
 
        mctx = imp->mctx;
        isc_mem_put(mctx, imp, sizeof(dns_sdbimplementation_t));
@@ -554,7 +554,7 @@ destroy(dns_sdb_t *sdb) {
        }
 
        isc_mem_free(mctx, sdb->zone);
-       DESTROYLOCK(&sdb->lock);
+       isc_mutex_destroy(&sdb->lock);
 
        sdb->common.magic = 0;
        sdb->common.impmagic = 0;
@@ -704,7 +704,7 @@ destroynode(dns_sdbnode_t *node) {
                dns_name_free(node->name, mctx);
                isc_mem_put(mctx, node->name, sizeof(dns_name_t));
        }
-       DESTROYLOCK(&node->lock);
+       isc_mutex_destroy(&node->lock);
        node->magic = 0;
        isc_mem_put(mctx, node, sizeof(dns_sdbnode_t));
        detach((dns_db_t **) (void *)&sdb);
@@ -1367,7 +1367,7 @@ dns_sdb_create(isc_mem_t *mctx, const dns_name_t *origin, dns_dbtype_t type,
  cleanup_origin:
        dns_name_free(&sdb->common.origin, mctx);
  cleanup_lock:
-       (void)isc_mutex_destroy(&sdb->lock);
+       isc_mutex_destroy(&sdb->lock);
        isc_mem_put(mctx, sdb, sizeof(dns_sdb_t));
        isc_mem_detach(&mctx);
 
index 405b149..1104bbc 100644 (file)
@@ -336,7 +336,7 @@ destroy(dns_sdlz_db_t *sdlz) {
        sdlz->common.magic = 0;
        sdlz->common.impmagic = 0;
 
-       (void)isc_mutex_destroy(&sdlz->refcnt_lock);
+       isc_mutex_destroy(&sdlz->refcnt_lock);
 
        dns_name_free(&sdlz->common.origin, mctx);
 
@@ -520,7 +520,7 @@ destroynode(dns_sdlznode_t *node) {
                dns_name_free(node->name, mctx);
                isc_mem_put(mctx, node->name, sizeof(dns_name_t));
        }
-       DESTROYLOCK(&node->lock);
+       isc_mutex_destroy(&node->lock);
        node->magic = 0;
        isc_mem_put(mctx, node, sizeof(dns_sdlznode_t));
        db = &sdlz->common;
@@ -2102,7 +2102,7 @@ dns_sdlzregister(const char *drivername, const dns_sdlzmethods_t *methods,
 
  cleanup_mutex:
        /* destroy the driver lock, we don't need it anymore */
-       DESTROYLOCK(&imp->driverlock);
+       isc_mutex_destroy(&imp->driverlock);
 
        /*
         * return the memory back to the available memory pool and
@@ -2132,7 +2132,7 @@ dns_sdlzunregister(dns_sdlzimplementation_t **sdlzimp) {
        dns_dlzunregister(&imp->dlz_imp);
 
        /* destroy the driver lock, we don't need it anymore */
-       DESTROYLOCK(&imp->driverlock);
+       isc_mutex_destroy(&imp->driverlock);
 
        mctx = imp->mctx;
 
index 7a6b530..9cb79c7 100644 (file)
@@ -103,7 +103,7 @@ destroy(dns_ssutable_t *table) {
                rule->magic = 0;
                isc_mem_put(mctx, rule, sizeof(dns_ssurule_t));
        }
-       DESTROYLOCK(&table->lock);
+       isc_mutex_destroy(&table->lock);
        table->magic = 0;
        isc_mem_putanddetach(&table->mctx, table, sizeof(dns_ssutable_t));
 }
index 4e63d42..6f0deeb 100644 (file)
@@ -117,7 +117,7 @@ dns_stats_detach(dns_stats_t **statsp) {
 
        if (stats->references == 0) {
                isc_stats_detach(&stats->counters);
-               DESTROYLOCK(&stats->lock);
+               isc_mutex_destroy(&stats->lock);
                isc_mem_putanddetach(&stats->mctx, stats, sizeof(*stats));
        }
 }
@@ -154,7 +154,7 @@ create_stats(isc_mem_t *mctx, dns_statstype_t type, int ncounters,
        return (ISC_R_SUCCESS);
 
   clean_mutex:
-       DESTROYLOCK(&stats->lock);
+       isc_mutex_destroy(&stats->lock);
        isc_mem_put(mctx, stats, sizeof(*stats));
 
        return (result);
index 1354e0b..fe046a3 100644 (file)
@@ -3810,7 +3810,7 @@ dns_validator_create(dns_view_t *view, dns_name_t *name, dns_rdatatype_t type,
        return (ISC_R_SUCCESS);
 
  cleanup_mutex:
-       DESTROYLOCK(&val->lock);
+       isc_mutex_destroy(&val->lock);
 
        isc_task_detach(&tclone);
        isc_event_free(ISC_EVENT_PTR(&event));
@@ -3895,7 +3895,7 @@ destroy(dns_validator_t *val) {
        mctx = val->view->mctx;
        if (val->siginfo != NULL)
                isc_mem_put(mctx, val->siginfo, sizeof(*val->siginfo));
-       DESTROYLOCK(&val->lock);
+       isc_mutex_destroy(&val->lock);
        dns_view_weakdetach(&val->view);
        val->magic = 0;
        isc_mem_put(mctx, val, sizeof(*val));
index a568f62..8820a95 100644 (file)
@@ -304,7 +304,7 @@ dns_view_create(isc_mem_t *mctx, dns_rdataclass_t rdclass,
        }
 
  cleanup_new_zone_lock:
-       DESTROYLOCK(&view->new_zone_lock);
+       isc_mutex_destroy(&view->new_zone_lock);
 
        dns_badcache_destroy(&view->failcache);
 
@@ -327,7 +327,7 @@ dns_view_create(isc_mem_t *mctx, dns_rdataclass_t rdclass,
        }
 
  cleanup_mutex:
-       DESTROYLOCK(&view->lock);
+       isc_mutex_destroy(&view->lock);
 
        if (view->nta_file != NULL) {
                isc_mem_free(mctx, view->nta_file);
@@ -546,8 +546,8 @@ destroy(dns_view_t *view) {
        dns_aclenv_destroy(&view->aclenv);
        if (view->failcache != NULL)
                dns_badcache_destroy(&view->failcache);
-       DESTROYLOCK(&view->new_zone_lock);
-       DESTROYLOCK(&view->lock);
+       isc_mutex_destroy(&view->new_zone_lock);
+       isc_mutex_destroy(&view->lock);
        isc_mem_free(view->mctx, view->nta_file);
        isc_mem_free(view->mctx, view->name);
        isc_mem_putanddetach(&view->mctx, view, sizeof(*view));
index 5ac43fb..4d7b9e2 100644 (file)
@@ -1088,7 +1088,7 @@ dns_zone_create(dns_zone_t **zonep, isc_mem_t *mctx) {
        ZONEDB_DESTROYLOCK(&zone->dblock);
 
  free_mutex:
-       DESTROYLOCK(&zone->lock);
+       isc_mutex_destroy(&zone->lock);
 
        isc_mem_putanddetach(&zone->mctx, zone, sizeof(*zone));
        return (result);
@@ -1253,7 +1253,7 @@ zone_free(dns_zone_t *zone) {
 
        /* last stuff */
        ZONEDB_DESTROYLOCK(&zone->dblock);
-       DESTROYLOCK(&zone->lock);
+       isc_mutex_destroy(&zone->lock);
        zone->magic = 0;
        mctx = zone->mctx;
        isc_mem_put(mctx, zone, sizeof(*zone));
@@ -16194,7 +16194,7 @@ dns_zonemgr_create(isc_mem_t *mctx, isc_taskmgr_t *taskmgr,
 
 #if 0
  free_iolock:
-       DESTROYLOCK(&zmgr->iolock);
+       isc_mutex_destroy(&zmgr->iolock);
 #endif
  free_startupnotifyrl:
        isc_ratelimiter_detach(&zmgr->startupnotifyrl);
@@ -16531,7 +16531,7 @@ zonemgr_free(dns_zonemgr_t *zmgr) {
 
        zmgr->magic = 0;
 
-       DESTROYLOCK(&zmgr->iolock);
+       isc_mutex_destroy(&zmgr->iolock);
        isc_ratelimiter_detach(&zmgr->notifyrl);
        isc_ratelimiter_detach(&zmgr->refreshrl);
        isc_ratelimiter_detach(&zmgr->startupnotifyrl);
index e78b926..2ff54c2 100644 (file)
@@ -955,7 +955,7 @@ resolve_name(int family, const char *hostname, int flags,
        ISC_LIST_INIT(head.resstates);
        result = make_resstates(mctx, hostname, &head, conf);
        if (result != ISC_R_SUCCESS) {
-               DESTROYLOCK(&head.list_lock);
+               isc_mutex_destroy(&head.list_lock);
                return (EAI_FAIL);
        }
 
@@ -1066,7 +1066,7 @@ resolve_name(int family, const char *hostname, int flags,
        irs_context_destroy(&irsctx);
 #endif
 
-       DESTROYLOCK(&head.list_lock);
+       isc_mutex_destroy(&head.list_lock);
        return (error);
 }
 
index 2cdec11..f6a01a4 100644 (file)
@@ -309,7 +309,7 @@ isc_httpdmgr_create(isc_mem_t *mctx, isc_socket_t *sock, isc_task_t *task,
        isc_task_detach(&httpdmgr->task);
        isc_socket_detach(&httpdmgr->sock);
        isc_mem_detach(&httpdmgr->mctx);
-       (void)isc_mutex_destroy(&httpdmgr->lock);
+       isc_mutex_destroy(&httpdmgr->lock);
        isc_mem_put(mctx, httpdmgr, sizeof(isc_httpdmgr_t));
        return (result);
 }
@@ -357,7 +357,7 @@ httpdmgr_destroy(isc_httpdmgr_t *httpdmgr) {
        }
 
        UNLOCK(&httpdmgr->lock);
-       (void)isc_mutex_destroy(&httpdmgr->lock);
+       isc_mutex_destroy(&httpdmgr->lock);
 
        if (httpdmgr->ondestroy != NULL)
                (httpdmgr->ondestroy)(httpdmgr->cb_arg);
index f00088d..e401969 100644 (file)
@@ -21,7 +21,7 @@
 
 ISC_LANG_BEGINDECLS
 
-isc_result_t
+void
 isc_mutexblock_init(isc_mutex_t *block, unsigned int count);
 /*%<
  * Initialize a block of locks.  If an error occurs all initialized locks
@@ -33,13 +33,9 @@ isc_mutexblock_init(isc_mutex_t *block, unsigned int count);
  *
  *\li  count > 0
  *
- * Returns:
- *
- *\li  Any code isc_mutex_init() can return is a valid return for this
- *     function.
  */
 
-isc_result_t
+void
 isc_mutexblock_destroy(isc_mutex_t *block, unsigned int count);
 /*%<
  * Destroy a block of locks.
@@ -53,10 +49,6 @@ isc_mutexblock_destroy(isc_mutex_t *block, unsigned int count);
  *\li  Each lock in the block be initialized via isc_mutex_init() or
  *     the whole block was initialized via isc_mutex_initblock().
  *
- * Returns:
- *
- *\li  Any code isc_mutex_init() can return is a valid return for this
- *     function.
  */
 
 ISC_LANG_ENDDECLS
index 6f8919d..43080a8 100644 (file)
@@ -59,8 +59,8 @@
 #define ISC_QUEUE_DESTROY(queue) \
        do { \
                ISC_QLINK_INSIST(ISC_QUEUE_EMPTY(queue)); \
-               (void) isc_mutex_destroy(&(queue).taillock); \
-               (void) isc_mutex_destroy(&(queue).headlock); \
+               isc_mutex_destroy(&(queue).taillock); \
+               isc_mutex_destroy(&(queue).headlock); \
        } while (0)
 
 /*
index ecd9e8c..c4f6da8 100644 (file)
                                              ISC_MSG_UNLOCKED, "UNLOCKED"), \
                               (lp), __FILE__, __LINE__)); \
        } while (0)
-#define DESTROYLOCK(lp) \
-       RUNTIME_CHECK(isc_mutex_destroy((lp)) == ISC_R_SUCCESS)
-
 
 #define BROADCAST(cvp) do { \
        ISC_UTIL_TRACE(fprintf(stderr, "%s %p %s %d\n", \
        RUNTIME_CHECK(isc_rwlock_unlock((lp), (t)) == ISC_R_SUCCESS); \
        } while (0)
 
-#define DESTROYMUTEXBLOCK(bp, n) \
-       RUNTIME_CHECK(isc_mutexblock_destroy((bp), (n)) == ISC_R_SUCCESS)
-
 /*
  * List Macros.
  */
index 1626ffc..c2a98a1 100644 (file)
@@ -466,7 +466,7 @@ isc_log_destroy(isc_log_t **lctxp) {
                isc_logconfig_destroy(&lcfg);
        }
 
-       DESTROYLOCK(&lctx->lock);
+       isc_mutex_destroy(&lctx->lock);
 
        while ((message = ISC_LIST_HEAD(lctx->messages)) != NULL) {
                ISC_LIST_UNLINK(lctx->messages, message, link);
index 2733f61..e9f935f 100644 (file)
@@ -893,7 +893,7 @@ isc_mem_createx(size_t init_max_size, size_t target_size,
                        (ctx->memfree)(ctx->arg, ctx->debuglist);
 #endif /* ISC_MEM_TRACKLINES */
                if ((ctx->flags & ISC_MEMFLAG_NOLOCK) == 0)
-                       DESTROYLOCK(&ctx->lock);
+                       isc_mutex_destroy(&ctx->lock);
                (memfree)(arg, ctx);
        }
 
@@ -970,7 +970,7 @@ destroy(isc__mem_t *ctx) {
        }
 
        if ((ctx->flags & ISC_MEMFLAG_NOLOCK) == 0)
-               DESTROYLOCK(&ctx->lock);
+               isc_mutex_destroy(&ctx->lock);
        ctx->malloced -= sizeof(*ctx);
        if (ctx->checkfree)
                INSIST(ctx->malloced == 0);
index 9cbd470..95d262a 100644 (file)
 #include <isc/mutexblock.h>
 #include <isc/util.h>
 
-isc_result_t
+void
 isc_mutexblock_init(isc_mutex_t *block, unsigned int count) {
        unsigned int i;
 
        for (i = 0; i < count; i++) {
                isc_mutex_init(&block[i]);
        }
-
-       return (ISC_R_SUCCESS);
 }
 
-isc_result_t
+void
 isc_mutexblock_destroy(isc_mutex_t *block, unsigned int count) {
-       isc_result_t result;
        unsigned int i;
 
        for (i = 0; i < count; i++) {
-               result = isc_mutex_destroy(&block[i]);
-               if (result != ISC_R_SUCCESS)
-                       return (result);
+               isc_mutex_destroy(&block[i]);
        }
-
-       return (ISC_R_SUCCESS);
 }
index ed9c7c7..4f3a4d4 100644 (file)
@@ -103,12 +103,10 @@ void isc__mutex_init(isc_mutex_t *mp, const char *file, unsigned int line);
 
 #if ISC_MUTEX_PROFILE
 #define isc_mutex_destroy(mp) \
-       ((pthread_mutex_destroy((&(mp)->mutex)) == 0) ? \
-        ISC_R_SUCCESS : ISC_R_UNEXPECTED)
+       (RUNTIME_CHECK(pthread_mutex_destroy((&(mp)->mutex)) == 0))
 #else
 #define isc_mutex_destroy(mp) \
-       ((pthread_mutex_destroy((mp)) == 0) ? \
-        ISC_R_SUCCESS : ISC_R_UNEXPECTED)
+       (RUNTIME_CHECK(pthread_mutex_destroy((mp)) == 0))
 #endif
 
 #if ISC_MUTEX_PROFILE
index c7ab96e..803bd45 100644 (file)
@@ -33,7 +33,7 @@ isc_quota_destroy(isc_quota_t *quota) {
        quota->max = 0;
        quota->used = 0;
        quota->soft = 0;
-       DESTROYLOCK(&quota->lock);
+       isc_mutex_destroy(&quota->lock);
 }
 
 void
index e59301c..cd8755a 100644 (file)
@@ -97,7 +97,7 @@ isc_ratelimiter_create(isc_mem_t *mctx, isc_timermgr_t *timermgr,
        return (ISC_R_SUCCESS);
 
 free_mutex:
-       DESTROYLOCK(&rl->lock);
+       isc_mutex_destroy(&rl->lock);
        isc_mem_put(mctx, rl, sizeof(*rl));
        return (result);
 }
@@ -278,7 +278,7 @@ ratelimiter_shutdowncomplete(isc_task_t *task, isc_event_t *event) {
 
 static void
 ratelimiter_free(isc_ratelimiter_t *rl) {
-       DESTROYLOCK(&rl->lock);
+       isc_mutex_destroy(&rl->lock);
        isc_mem_put(rl->mctx, rl, sizeof(*rl));
 }
 
index c4e87ed..98a835e 100644 (file)
@@ -137,7 +137,7 @@ isc_rwlock_destroy(isc_rwlock_t *rwl) {
        rwl->magic = 0;
        (void)isc_condition_destroy(&rwl->readable);
        (void)isc_condition_destroy(&rwl->writeable);
-       DESTROYLOCK(&rwl->lock);
+       isc_mutex_destroy(&rwl->lock);
 }
 
 /*
index 9fec283..1229e53 100644 (file)
@@ -101,7 +101,7 @@ clean_counters:
        isc_mem_put(mctx, stats->counters, sizeof(isc_stat_t) * ncounters);
 
 clean_mutex:
-       DESTROYLOCK(&stats->lock);
+       isc_mutex_destroy(&stats->lock);
        isc_mem_put(mctx, stats, sizeof(*stats));
 
        return (result);
@@ -137,7 +137,7 @@ isc_stats_detach(isc_stats_t **statsp) {
                isc_mem_put(stats->mctx, stats->counters,
                            sizeof(isc_stat_t) * stats->ncounters);
                UNLOCK(&stats->lock);
-               DESTROYLOCK(&stats->lock);
+               isc_mutex_destroy(&stats->lock);
                isc_mem_putanddetach(&stats->mctx, stats, sizeof(*stats));
                return;
        }
index 5808054..ef0d311 100644 (file)
@@ -235,7 +235,7 @@ task_finished(isc__task_t *task) {
                 */
                wake_all_queues(manager);
        }
-       DESTROYLOCK(&task->lock);
+       isc_mutex_destroy(&task->lock);
        task->common.impmagic = 0;
        task->common.magic = 0;
        isc_mem_put(manager->mctx, task, sizeof(*task));
@@ -288,7 +288,7 @@ isc_task_create(isc_taskmgr_t *manager0, unsigned int quantum,
        UNLOCK(&manager->lock);
 
        if (exiting) {
-               DESTROYLOCK(&task->lock);
+               isc_mutex_destroy(&task->lock);
                isc_mem_put(manager->mctx, task, sizeof(*task));
                return (ISC_R_SHUTTINGDOWN);
        }
@@ -1301,10 +1301,10 @@ run(void *queuep) {
 static void
 manager_free(isc__taskmgr_t *manager) {
        for (unsigned int i = 0; i < manager->workers; i++) {
-               DESTROYLOCK(&manager->queues[i].lock);
+               isc_mutex_destroy(&manager->queues[i].lock);
        }
-       DESTROYLOCK(&manager->lock);
-       DESTROYLOCK(&manager->halt_lock);
+       isc_mutex_destroy(&manager->lock);
+       isc_mutex_destroy(&manager->halt_lock);
        isc_mem_put(manager->mctx, manager->queues,
                    manager->workers * sizeof(isc__taskqueue_t));
        manager->common.impmagic = 0;
index 7df08db..1415a3f 100644 (file)
@@ -136,7 +136,7 @@ setup_test(isc_timertype_t timertype, isc_time_t *expires,
        UNLOCK(&mx);
 
        isc_task_detach(&task);
-       DESTROYLOCK(&mx);
+       isc_mutex_destroy(&mx);
        (void) isc_condition_destroy(&cv);
 }
 
@@ -558,7 +558,7 @@ purge(void **state) {
        isc_timer_detach(&oncetimer);
        isc_task_destroy(&task1);
        isc_task_destroy(&task2);
-       DESTROYLOCK(&mx);
+       isc_mutex_destroy(&mx);
 }
 
 int
index 540bf28..94c55fb 100644 (file)
@@ -234,7 +234,7 @@ destroy(isc__timer_t *timer) {
        UNLOCK(&manager->lock);
 
        isc_task_detach(&timer->task);
-       DESTROYLOCK(&timer->lock);
+       isc_mutex_destroy(&timer->lock);
        timer->common.impmagic = 0;
        timer->common.magic = 0;
        isc_mem_put(manager->mctx, timer, sizeof(*timer));
@@ -347,7 +347,7 @@ isc_timer_create(isc_timermgr_t *manager0, isc_timertype_t type,
        if (result != ISC_R_SUCCESS) {
                timer->common.impmagic = 0;
                timer->common.magic = 0;
-               DESTROYLOCK(&timer->lock);
+               isc_mutex_destroy(&timer->lock);
                isc_task_detach(&timer->task);
                isc_mem_put(manager->mctx, timer, sizeof(*timer));
                return (result);
@@ -745,7 +745,7 @@ isc_timermgr_create(isc_mem_t *mctx, isc_timermgr_t **managerp) {
            ISC_R_SUCCESS) {
                isc_mem_detach(&manager->mctx);
                (void)isc_condition_destroy(&manager->wakeup);
-               DESTROYLOCK(&manager->lock);
+               isc_mutex_destroy(&manager->lock);
                isc_heap_destroy(&manager->heap);
                isc_mem_put(mctx, manager, sizeof(*manager));
                UNEXPECTED_ERROR(__FILE__, __LINE__,
@@ -807,7 +807,7 @@ isc_timermgr_destroy(isc_timermgr_t **managerp) {
         * Clean up.
         */
        (void)isc_condition_destroy(&manager->wakeup);
-       DESTROYLOCK(&manager->lock);
+       isc_mutex_destroy(&manager->lock);
        isc_heap_destroy(&manager->heap);
        manager->common.impmagic = 0;
        manager->common.magic = 0;
index 983ce9f..c248672 100644 (file)
@@ -568,7 +568,7 @@ isc_app_ctxfinish(isc_appctx_t *ctx0) {
 
        REQUIRE(VALID_APPCTX(ctx));
 
-       DESTROYLOCK(&ctx->lock);
+       isc_mutex_destroy(&ctx->lock);
 }
 
 void
index f667d49..ff9efe5 100644 (file)
@@ -1967,7 +1967,7 @@ free_socket(isc__socket_t **socketp) {
        sock->common.magic = 0;
        sock->common.impmagic = 0;
 
-       DESTROYLOCK(&sock->lock);
+       isc_mutex_destroy(&sock->lock);
 
        isc_mem_put(sock->manager->mctx, sock, sizeof(*sock));
 
@@ -3890,7 +3890,7 @@ cleanup_thread(isc_mem_t *mctx, isc__socketthread_t *thread) {
 
        if (thread->fdlock != NULL) {
                for (i = 0; i < FDLOCK_COUNT; i++) {
-                       DESTROYLOCK(&thread->fdlock[i]);
+                       isc_mutex_destroy(&thread->fdlock[i]);
                }
                isc_mem_put(thread->manager->mctx, thread->fdlock,
                            FDLOCK_COUNT * sizeof(isc_mutex_t));
@@ -4045,7 +4045,7 @@ isc_socketmgr_destroy(isc_socketmgr_t **managerp) {
        if (manager->stats != NULL) {
                isc_stats_detach(&manager->stats);
        }
-       DESTROYLOCK(&manager->lock);
+       isc_mutex_destroy(&manager->lock);
        manager->common.magic = 0;
        manager->common.impmagic = 0;
        mctx= manager->mctx;
index e3d4c7b..156c8ff 100644 (file)
@@ -328,7 +328,7 @@ isc_app_ctxfinish(isc_appctx_t *ctx0) {
 
        REQUIRE(VALID_APPCTX(ctx));
 
-       DESTROYLOCK(&ctx->lock);
+       isc_mutex_destroy(&ctx->lock);
 }
 
 void
index 1d49430..28a08a0 100644 (file)
@@ -38,7 +38,7 @@ TryEnterCriticalSection(LPCRITICAL_SECTION lpCriticalSection);
 #define isc_mutex_trylock(mp) \
        (TryEnterCriticalSection((mp)) ? ISC_R_SUCCESS : ISC_R_LOCKBUSY)
 #define isc_mutex_destroy(mp) \
-       (DeleteCriticalSection((mp)), ISC_R_SUCCESS)
+       (DeleteCriticalSection((mp)))
 
 /*
  * This is a placeholder for now since we are not keeping any mutex stats
index 761a1d2..9e5969b 100644 (file)
@@ -1507,7 +1507,7 @@ free_socket(isc_socket_t **sockp, int lineno) {
                   lineno, sock->fd, &sock->lock, sock->lock.LockSemaphore);
 
        sock->magic = 0;
-       DESTROYLOCK(&sock->lock);
+       isc_mutex_destroy(&sock->lock);
 
        if (sock->recvbuf.base != NULL)
                isc_mem_put(manager->mctx, sock->recvbuf.base,
@@ -2647,7 +2647,7 @@ isc_socketmgr_destroy(isc_socketmgr_t **managerp) {
 
        (void)isc_condition_destroy(&manager->shutdown_ok);
 
-       DESTROYLOCK(&manager->lock);
+       isc_mutex_destroy(&manager->lock);
        if (manager->stats != NULL)
                isc_stats_detach(&manager->stats);
        manager->magic = 0;
index 83d6342..9ae04be 100644 (file)
@@ -652,7 +652,7 @@ exit_check(ns_client_t *client) {
                 * Destroy the fetchlock mutex that was created in
                 * ns_query_init().
                 */
-               DESTROYLOCK(&client->query.fetchlock);
+               isc_mutex_destroy(&client->query.fetchlock);
 
                if (client->sctx != NULL)
                        ns_server_detach(&client->sctx);
@@ -3394,9 +3394,9 @@ clientmgr_destroy(ns_clientmgr_t *manager) {
 
        ISC_QUEUE_DESTROY(manager->inactive);
 
-       DESTROYLOCK(&manager->lock);
-       DESTROYLOCK(&manager->listlock);
-       DESTROYLOCK(&manager->reclock);
+       isc_mutex_destroy(&manager->lock);
+       isc_mutex_destroy(&manager->listlock);
+       isc_mutex_destroy(&manager->reclock);
 
        if (manager->excl != NULL)
                isc_task_detach(&manager->excl);
@@ -3456,9 +3456,9 @@ ns_clientmgr_create(isc_mem_t *mctx, ns_server_t *sctx, isc_taskmgr_t *taskmgr,
        return (ISC_R_SUCCESS);
 
  cleanup_reclock:
-       (void) isc_mutex_destroy(&manager->reclock);
-       (void) isc_mutex_destroy(&manager->listlock);
-       (void) isc_mutex_destroy(&manager->lock);
+       isc_mutex_destroy(&manager->reclock);
+       isc_mutex_destroy(&manager->listlock);
+       isc_mutex_destroy(&manager->lock);
 
        isc_mem_put(manager->mctx, manager, sizeof(*manager));
 
index ae539c2..865abe7 100644 (file)
@@ -306,7 +306,7 @@ ns_interfacemgr_destroy(ns_interfacemgr_t *mgr) {
        ns_listenlist_detach(&mgr->listenon4);
        ns_listenlist_detach(&mgr->listenon6);
        clearlistenon(mgr);
-       DESTROYLOCK(&mgr->lock);
+       isc_mutex_destroy(&mgr->lock);
        if (mgr->sctx != NULL)
                ns_server_detach(&mgr->sctx);
        if (mgr->excl != NULL)
@@ -443,7 +443,7 @@ ns_interface_create(ns_interfacemgr_t *mgr, isc_sockaddr_t *addr,
        return (ISC_R_SUCCESS);
 
  clientmgr_create_failure:
-       DESTROYLOCK(&ifp->lock);
+       isc_mutex_destroy(&ifp->lock);
 
        ifp->magic = 0;
        isc_mem_put(mgr->mctx, ifp, sizeof(*ifp));
@@ -656,7 +656,7 @@ ns_interface_destroy(ns_interface_t *ifp) {
        if (ifp->tcpsocket != NULL)
                isc_socket_detach(&ifp->tcpsocket);
 
-       DESTROYLOCK(&ifp->lock);
+       isc_mutex_destroy(&ifp->lock);
 
        ns_interfacemgr_detach(&ifp->mgr);
 
index b649254..64a38e4 100644 (file)
@@ -949,13 +949,13 @@ ns_query_init(ns_client_t *client) {
        query_reset(client, false);
        result = query_newdbversion(client, 3);
        if (result != ISC_R_SUCCESS) {
-               DESTROYLOCK(&client->query.fetchlock);
+               isc_mutex_destroy(&client->query.fetchlock);
                return (result);
        }
        result = query_newnamebuf(client);
        if (result != ISC_R_SUCCESS) {
                query_freefreeversions(client, true);
-               DESTROYLOCK(&client->query.fetchlock);
+               isc_mutex_destroy(&client->query.fetchlock);
        }
 
        return (result);
index 0555fc3..d34ce9b 100644 (file)
@@ -61,7 +61,7 @@ ns_stats_detach(ns_stats_t **statsp) {
 
        if (stats->references == 0) {
                isc_stats_detach(&stats->counters);
-               DESTROYLOCK(&stats->lock);
+               isc_mutex_destroy(&stats->lock);
                isc_mem_putanddetach(&stats->mctx, stats, sizeof(*stats));
        }
 }
@@ -94,7 +94,7 @@ ns_stats_create(isc_mem_t *mctx, int ncounters, ns_stats_t **statsp) {
        return (ISC_R_SUCCESS);
 
   clean_mutex:
-       DESTROYLOCK(&stats->lock);
+       isc_mutex_destroy(&stats->lock);
        isc_mem_put(mctx, stats, sizeof(*stats));
 
        return (result);