Struct stoppable_thread::StoppableHandle [] [src]

pub struct StoppableHandle<T> {
    // some fields omitted
}

A handle for a stoppable thread

The interface is similar to std::thread::JoinHandle<T>, supporting thread and join with the same signature.

Methods

impl<T> StoppableHandle<T>

fn thread(&self) -> &Thread

fn join(self) -> Result<T>

fn stop(self) -> JoinHandle<T>

Stop the thread

This will signal the thread to stop by setting the shared atomic stopped variable to True. The function will return immediately after, to wait for the thread to stop, use the returned JoinHandle<T> and wait().