Example #1
0
File: zt.c Project: crossbuild/bind
isc_result_t
dns_zt_asyncload(dns_zt_t *zt, dns_zt_allloaded_t alldone, void *arg) {
	isc_result_t result;
	static dns_zt_zoneloaded_t dl = doneloading;
	int pending;

	REQUIRE(VALID_ZT(zt));

	RWLOCK(&zt->rwlock, isc_rwlocktype_write);

	INSIST(zt->loads_pending == 0);
	result = dns_zt_apply2(zt, ISC_FALSE, NULL, asyncload, &dl);

	pending = zt->loads_pending;
	if (pending != 0) {
		zt->loaddone = alldone;
		zt->loaddone_arg = arg;
	}

	RWUNLOCK(&zt->rwlock, isc_rwlocktype_write);

	if (pending == 0)
		alldone(arg);

	return (result);
}
Example #2
0
isc_result_t
dns_zt_freezezones(dns_zt_t *zt, isc_boolean_t freeze) {
	isc_result_t result, tresult;

	REQUIRE(VALID_ZT(zt));

	RWLOCK(&zt->rwlock, isc_rwlocktype_read);
	result = dns_zt_apply2(zt, ISC_FALSE, &tresult, freezezones, &freeze);
	RWUNLOCK(&zt->rwlock, isc_rwlocktype_read);
	return ((result == ISC_R_SUCCESS) ? tresult : result);
}
Example #3
0
isc_result_t
dns_zt_apply(dns_zt_t *zt, isc_boolean_t stop,
	     isc_result_t (*action)(dns_zone_t *, void *), void *uap)
{
	return (dns_zt_apply2(zt, stop, NULL, action, uap));
}