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

Remove atomics emulated by a mutex-locked variable

Mutex atomics were intended to be used as a debugging tool only
and it has already served its purpose and it's not needed anymore.
This commit is contained in:
Ondřej Surý
2021-06-03 08:03:00 +02:00
parent aa626c6499
commit 4677bb28d1
8 changed files with 0 additions and 323 deletions

View File

@@ -6288,14 +6288,6 @@ recparam_update(ns_query_recparam_t *param, dns_rdatatype_t qtype,
}
}
static atomic_uint_fast32_t last_soft, last_hard;
#ifdef ISC_MUTEX_ATOMICS
static isc_once_t last_once = ISC_ONCE_INIT;
static void
last_init(void) {
atomic_init(&last_soft, 0);
atomic_init(&last_hard, 0);
}
#endif /* ifdef ISC_MUTEX_ATOMICS */
/*%
* Check recursion quota before making the current client "recursing".
@@ -6324,9 +6316,6 @@ check_recursionquota(ns_client_t *client) {
}
if (result == ISC_R_SOFTQUOTA) {
#ifdef ISC_MUTEX_ATOMICS
isc_once_do(&last_once, last_init);
#endif /* ifdef ISC_MUTEX_ATOMICS */
isc_stdtime_t now;
isc_stdtime_get(&now);
if (now != atomic_load_relaxed(&last_soft)) {
@@ -6347,9 +6336,6 @@ check_recursionquota(ns_client_t *client) {
ns_client_killoldestquery(client);
result = ISC_R_SUCCESS;
} else if (result == ISC_R_QUOTA) {
#ifdef ISC_MUTEX_ATOMICS
isc_once_do(&last_once, last_init);
#endif /* ifdef ISC_MUTEX_ATOMICS */
isc_stdtime_t now;
isc_stdtime_get(&now);
if (now != atomic_load_relaxed(&last_hard)) {