2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 06:25:31 +00:00

configuration locking checkpoint

This commit is contained in:
Andreas Gustafsson
2000-01-27 01:00:16 +00:00
parent 5137961d7c
commit 143c2d39fa
9 changed files with 153 additions and 40 deletions

View File

@@ -77,6 +77,14 @@ dns_view_create(isc_mem_t *mctx, dns_rdataclass_t rdclass,
result = ISC_R_UNEXPECTED;
goto cleanup_name;
}
result = isc_rwlock_init(&view->conflock, UINT_MAX, UINT_MAX);
if (result != ISC_R_SUCCESS) {
UNEXPECTED_ERROR(__FILE__, __LINE__,
"isc_rwlock_init() failed: %s",
isc_result_totext(result));
result = ISC_R_UNEXPECTED;
goto cleanup_mutex;
}
view->zonetable = NULL;
result = dns_zt_create(mctx, rdclass, &view->zonetable);
if (result != ISC_R_SUCCESS) {
@@ -84,7 +92,7 @@ dns_view_create(isc_mem_t *mctx, dns_rdataclass_t rdclass,
"dns_zt_create() failed: %s",
isc_result_totext(result));
result = ISC_R_UNEXPECTED;
goto cleanup_mutex;
goto cleanup_rwlock;
}
view->secroots = NULL;
result = dns_rbt_create(mctx, NULL, NULL, &view->secroots);
@@ -128,6 +136,9 @@ dns_view_create(isc_mem_t *mctx, dns_rdataclass_t rdclass,
cleanup_zt:
dns_zt_detach(&view->zonetable);
cleanup_rwlock:
isc_rwlock_destroy(&view->conflock);
cleanup_mutex:
isc_mutex_destroy(&view->lock);