diff --git a/lib/isc/lib.c b/lib/isc/lib.c index bdff8efd35..c0f9d30dba 100644 --- a/lib/isc/lib.c +++ b/lib/isc/lib.c @@ -67,6 +67,9 @@ isc__lib_shutdown(void) { return; } + rcu_barrier(); + rcu_unregister_thread(); + isc__iterated_hash_shutdown(); isc__xml_shutdown(); isc__uv_shutdown(); @@ -75,6 +78,4 @@ isc__lib_shutdown(void) { isc__mem_shutdown(); isc__mutex_shutdown(); isc__os_shutdown(); - /* should be after isc__mem_shutdown() which calls rcu_barrier() */ - rcu_unregister_thread(); } diff --git a/lib/isc/mem.c b/lib/isc/mem.c index c1b0ab7331..ff34485ae0 100644 --- a/lib/isc/mem.c +++ b/lib/isc/mem.c @@ -434,10 +434,9 @@ isc__mem_initialize(void) { void isc__mem_shutdown(void) { + /* should be called after an rcu_barrier() */ bool empty; - rcu_barrier(); - isc__mem_checkdestroyed(); LOCK(&contextslock);