21 #ifdef STXXL_EXTERNAL_EXIT_HANDLER 22 static_assert(
false,
"STXXL_EXTERNAL_EXIT_HANDLER was renamed to FOXXLL_EXTERNAL_EXIT_HANDLER");
25 #ifdef STXXL_NON_DEFAULT_EXIT_HANDLER 26 static_assert(
false,
"STXXL_NON_DEFAULT_EXIT_HANDLER was renamed to FOXXLL_NON_DEFAULT_EXIT_HANDLER");
29 #ifndef FOXXLL_EXTERNAL_EXIT_HANDLER 30 #ifndef FOXXLL_NON_DEFAULT_EXIT_HANDLER 37 return atexit(
function);
48 #else // FOXXLL_NON_DEFAULT_EXIT_HANDLER 55 std::mutex exit_handler_mutex;
56 std::vector<void (*)(void)> exit_handlers;
60 std::unique_lock<std::mutex> lock(exit_handler_mutex);
61 exit_handlers.push_back(
function);
68 std::unique_lock<std::mutex> lock(exit_handler_mutex);
69 while (!exit_handlers.empty()) {
70 (*(exit_handlers.back()))();
71 exit_handlers.pop_back();
77 #endif // FOXXLL_NON_DEFAULT_EXIT_HANDLER 78 #endif // FOXXLL_EXTERNAL_EXIT_HANDLER
int register_exit_handler(void(*function)(void))