class HaltToken

Defined at line 20 of file ../../zircon/kernel/include/platform/halt_token.h

This object is used to coordinate concurrent halt/reboot operations.

The idea is there's a single resource, the "halt token" and only the holder of the token may

initiate a halt/reboot (except for panics).

Public Methods

HaltToken & Get ()

Accessor for the global singleton halt token.

Defined at line 23 of file ../../zircon/kernel/include/platform/halt_token.h

bool Take ()

The Take method attempts to acquire the token and signals an irrevocable

intention to halt (or reboot) the system.

If this method returns true, the caller has acquired the token and is now

responsible for halting/reboot.

If this method returns false, the caller failed to acquire the token

(because some other caller got it). In this case the caller must take no

action and allow the holder to halt/reboot.

Defined at line 34 of file ../../zircon/kernel/include/platform/halt_token.h

zx_status_t WaitForAck (const Deadline & deadline)

Wait until |deadline| for user-mode to acknowledge a kernel-signaled Halt.

In practice, this occurs when the kernel memory watchdog encounters a fatal

OOM condition and signals user mode, in order to give it a last chance to

persist logs and cleanly shutdown drivers before the reboot actually takes

place.

Defined at line 41 of file ../../zircon/kernel/include/platform/halt_token.h

zx_status_t AckPendingHalt ()

Called during processing of the

ZX_SYSTEM_POWERCTL_ACK_KERNEL_INITIATED_REBOOT topic in zx_system_powerctl.

Indicates that user-mode has finished responding to the kernel's signal of

an impending reboot, and that user-mode is now ready for the reboot to

proceed.

If the halt token has not yet been claimed, this function will return an

error and leave the ack_event_ in the unsignaled state.

Defined at line 51 of file ../../zircon/kernel/include/platform/halt_token.h