#[non_exhaustive]pub enum ThreadTerminationOption {
Normal,
Prompt,
Never,
}Expand description
What a thread does when its execution is asked to terminate
(ThreadTerminationOptions).
An execution cannot finish terminating while any of its threads refuses to
stop, so this decides whether Execution::terminate completes promptly or
waits.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Normal
Stop with the execution. The default, and what an unattended host wants almost everywhere.
Prompt
Refuse to stop unless the execution is told to override refusals.
When every remaining thread chooses this, the engine posts
UIMsg_NonTerminatableThreadsArePreventingTermination and waits. On a
station with somebody watching, that is a question. On a headless host
it is a termination that never finishes unless the host handles that
message and overrides, so treat this as something to notice rather than
something to set casually.
Never
Never stop with the execution; the thread runs to its own end first.
For work that must not be cut in half, such as leaving hardware in a safe state. The execution cannot end until the thread does, so anything choosing this needs a bounded amount of work left to do.
Implementations§
Trait Implementations§
Source§impl Clone for ThreadTerminationOption
impl Clone for ThreadTerminationOption
Source§fn clone(&self) -> ThreadTerminationOption
fn clone(&self) -> ThreadTerminationOption
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more