Pre-exit handler registration (at_pre_exit, pre_exit).
More...
|
|
using | stlab::pre_exit_handler |
| | Function type invoked during pre_exit() (must not throw; noexcept with C++17 and later).
|
|
|
void | stlab::stlab_pre_exit () |
| | An extern "C" vector for pre-exit() to make it simpler to export the function from a shared library.
|
|
void | stlab::stlab_at_pre_exit (pre_exit_handler f) |
| | An extern "C" vector for at_pre-exit() to make it simpler to export the function from a shared library.
|
| void | stlab::pre_exit () |
| | Invoke all registered pre-exit handlers in the reverse order they are registered. It is safe to register additional handlers during this operation. Must be invoked exactly once prior to program exit. Handlers needed to unblock running core work must be registered after the first timer or default-executor use and before invoking pre_exit(). On threadless Emscripten, returns after initiating retirement; the next ordinary main task runs only after executor work and deferred handlers finish. Default/high/low submission remains available during the drain and is a precondition violation after it completes.
|
| void | stlab::at_pre_exit (pre_exit_handler f) |
| | Register a pre-exit handler. The pre-exit-handler may not throw. With C++17 or later it is required to be noexcept.
|
Pre-exit handler registration (at_pre_exit, pre_exit).
◆ at_pre_exit()
| void stlab::v2::at_pre_exit |
( |
pre_exit_handler | f | ) |
|
|
inline |
Register a pre-exit handler. The pre-exit-handler may not throw. With C++17 or later it is required to be noexcept.
- Precondition: f is not null and pre_exit() has not completed.
◆ pre_exit()
| void stlab::v2::pre_exit |
( |
| ) |
|
|
inline |
Invoke all registered pre-exit handlers in the reverse order they are registered. It is safe to register additional handlers during this operation. Must be invoked exactly once prior to program exit. Handlers needed to unblock running core work must be registered after the first timer or default-executor use and before invoking pre_exit(). On threadless Emscripten, returns after initiating retirement; the next ordinary main task runs only after executor work and deferred handlers finish. Default/high/low submission remains available during the drain and is a precondition violation after it completes.
- Complexity: linear in invoked handlers, excluding the work performed by those handlers.