From: Arran Cudbard-Bell Date: Tue, 22 Feb 2022 20:30:12 +0000 (-0500) Subject: Add atexit state function X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b9c4dd1d93c6a2dab6029723546e92ef2d6c14b6;p=thirdparty%2Ffreeradius-server.git Add atexit state function --- diff --git a/src/lib/util/atexit.c b/src/lib/util/atexit.c index ea8acd8939e..273c4ae4479 100644 --- a/src/lib/util/atexit.c +++ b/src/lib/util/atexit.c @@ -508,3 +508,13 @@ unsigned int fr_atexit_thread_trigger_all(void) return count; } + +/** Return whether we're currently in the teardown phase + * + * When this function returns true no more thread local or global + * destructors can be added. + */ +bool fr_atexit_is_exiting(void) +{ + return is_exiting; +} diff --git a/src/lib/util/atexit.h b/src/lib/util/atexit.h index ae013197074..9d1dc0911bb 100644 --- a/src/lib/util/atexit.h +++ b/src/lib/util/atexit.h @@ -125,6 +125,8 @@ unsigned int fr_atexit_trigger(bool uctx_scope, fr_atexit_t func, void const *uc unsigned int fr_atexit_thread_trigger_all(void); +bool fr_atexit_is_exiting(void); + #ifdef __cplusplus } #endif