diff options
author | Devtools Arcadia <arcadia-devtools@yandex-team.ru> | 2022-02-07 18:08:42 +0300 |
---|---|---|
committer | Devtools Arcadia <arcadia-devtools@mous.vla.yp-c.yandex.net> | 2022-02-07 18:08:42 +0300 |
commit | 1110808a9d39d4b808aef724c861a2e1a38d2a69 (patch) | |
tree | e26c9fed0de5d9873cce7e00bc214573dc2195b7 /util/system/atexit.h | |
download | ydb-1110808a9d39d4b808aef724c861a2e1a38d2a69.tar.gz |
intermediate changes
ref:cde9a383711a11544ce7e107a78147fb96cc4029
Diffstat (limited to 'util/system/atexit.h')
-rw-r--r-- | util/system/atexit.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/util/system/atexit.h b/util/system/atexit.h new file mode 100644 index 0000000000..eb3188615c --- /dev/null +++ b/util/system/atexit.h @@ -0,0 +1,22 @@ +#pragma once + +#include "defaults.h" + +using TAtExitFunc = void (*)(void*); +using TTraditionalAtExitFunc = void (*)(); + +void AtExit(TAtExitFunc func, void* ctx); +void AtExit(TAtExitFunc func, void* ctx, size_t priority); + +void AtExit(TTraditionalAtExitFunc func); +void AtExit(TTraditionalAtExitFunc func, size_t priority); + +bool ExitStarted(); + +/** + * Generally it's a bad idea to call this method except for some rare cases, + * like graceful python DLL module unload. + * This function is not threadsafe. + * Calls in the moment when application is not terminating - bad idea. + */ +void ManualRunAtExitFinalizers(); |