mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-31 06:25:31 +00:00
REQUIRE should not have side effects
it's a style violation to have REQUIRE or INSIST contain code that must run for the server to work. this was being done with some atomic_compare_exchange calls. these have been cleaned up. uses of atomic_compare_exchange in assertions have been replaced with a new macro atomic_compare_exchange_enforced, which uses RUNTIME_CHECK to ensure that the exchange was successful.
This commit is contained in:
@@ -128,8 +128,7 @@ tls_initialize(void) {
|
||||
"seeded' message in the OpenSSL FAQ)");
|
||||
}
|
||||
|
||||
REQUIRE(atomic_compare_exchange_strong(&init_done, &(bool){ false },
|
||||
true));
|
||||
atomic_compare_exchange_enforced(&init_done, &(bool){ false }, true);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -167,8 +166,7 @@ tls_shutdown(void) {
|
||||
}
|
||||
#endif
|
||||
|
||||
REQUIRE(atomic_compare_exchange_strong(&shut_done, &(bool){ false },
|
||||
true));
|
||||
atomic_compare_exchange_enforced(&shut_done, &(bool){ false }, true);
|
||||
}
|
||||
|
||||
void
|
||||
|
Reference in New Issue
Block a user