Struct std::thread::JoinGuardUnstable [-]  [+] [src]

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

An RAII-style guard that will block until thread termination when dropped.

The type T is the return type for the thread's main function.

Methods

impl<T: Send> JoinGuard<T>

fn thread(&self) -> &Thread

Extract a handle to the thread this guard will join on.

fn join(self) -> Result<T>

Wait for the associated thread to finish, returning the result of the thread's calculation.

If the child thread panics, Err is returned with the parameter given to panic.

fn detach(self)

Detaches the child thread, allowing it to outlive its parent.

Trait Implementations

impl<T: Send> Sync for JoinGuard<T>

impl<T: Send> Drop for JoinGuard<T>

fn drop(&mut self)