associate a lock with the memory pool in the filter-aaaa plugin

This commit is contained in:
Evan Hunt
2019-04-24 21:52:06 -07:00
parent 2c85466c67
commit 4f4c18d643

View 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);