static fr_atexit_list_t *fr_atexit_global = NULL;
static bool is_exiting;
+static _Thread_local bool thread_is_exiting;
/** Call the exit handler
*
*/
static int _thread_local_free(void *list)
{
+ thread_is_exiting = true;
return talloc_free(list);
}
return count;
}
+
+/** Return whether the thread is currently being cleaned up
+ *
+ */
+bool fr_atexit_thread_is_exiting(void)
+{
+ return thread_is_exiting;
+}
#endif
int fr_atexit_thread_trigger_all(void);
+bool fr_atexit_thread_is_exiting(void);
+
/*
* If we're building without threading support,
* all this becomes much easier, and we just map