]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Add atexit state function
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Tue, 22 Feb 2022 20:30:12 +0000 (15:30 -0500)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Tue, 22 Feb 2022 21:02:34 +0000 (16:02 -0500)
src/lib/util/atexit.c
src/lib/util/atexit.h

index ea8acd8939ed9a6003e9c2bacddf4eb174a67f55..273c4ae447959d0fdbf316b04437ff5eb2f3ba87 100644 (file)
@@ -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;
+}
index ae013197074b8292896b0252bdd2af57cbe9c2b9..9d1dc0911bb19c0956400dfb03510b43f1cde018 100644 (file)
@@ -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