hpx::supervision::finalize#

Defined in header hpx/supervision_dispatch.hpp.

See Public API for a list of names and headers that are part of the public HPX API.

See also:

void hpx::supervision::finalize()#

Performs one-shot, idempotent teardown of the supervision-dispatch runtime previously started by init(). On the first call observing the active state, this function atomically transitions the lifecycle to finalizing, publishes event::completed for the local locality at the current epoch, unregisters the registry’s symbol name, and then releases ownership of the registry (relying on client_base’s default lifetime management to destroy it once no other references remain) before resetting the lifecycle back to uninitialized, allowing a subsequent init() call to re-arm the runtime from scratch.

Calling finalize() when the runtime is uninitialized, still initializing, or already finalizing is a documented no-op: it resolves immediately without publishing any event, unregistering any symbol name, or otherwise touching component state.

Note

Because finalize() is a no-op unless the runtime is currently active, it is always safe to call speculatively, e.g. during shutdown, without first checking is_initialized().