]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
associate a lock with the memory pool in the filter-aaaa plugin
authorEvan Hunt <each@isc.org>
Thu, 25 Apr 2019 04:52:06 +0000 (21:52 -0700)
committerEvan Hunt <each@isc.org>
Fri, 26 Apr 2019 06:52:39 +0000 (02:52 -0400)
bin/plugins/filter-aaaa.c

index 838fb7aefa5d6ef53571fd2ac3e75317c22a0fc1..e62dff59af3a19064bfd900cd3ae7b3a5cd8cba6 100644 (file)
@@ -83,6 +83,7 @@ typedef struct filter_instance {
         * Memory pool for use with persistent data.
         */
        isc_mempool_t *datapool;
+       isc_mutex_t plock;
 
        /*
         * Hash table associating a client object with its persistent data.
@@ -388,6 +389,8 @@ plugin_register(const char *parameters,
         */
        isc_mempool_setfillcount(inst->datapool, 1024);
        isc_mempool_setfreemax(inst->datapool, UINT_MAX);
+       isc_mutex_init(&inst->plock);
+       isc_mempool_associatelock(inst->datapool, &inst->plock);
 
        /*
         * Set hook points in the view's hooktable.
@@ -446,6 +449,7 @@ plugin_destroy(void **instp) {
        }
        if (inst->datapool != NULL) {
                isc_mempool_destroy(&inst->datapool);
+               isc_mutex_destroy(&inst->plock);
        }
        if (inst->aaaa_acl != NULL) {
                dns_acl_detach(&inst->aaaa_acl);