Struct crossbeam_utils::thread::Scope[][src]

pub struct Scope<'a> { /* fields omitted */ }


impl<'a> Scope<'a>

Schedule code to be executed when exiting the scope.

This is akin to having a destructor on the stack, except that it is guaranteed to be run. It is guaranteed that the function is called after all the spawned threads are joined.

Create a scoped thread.

spawn is similar to the spawn function in Rust's standard library. The difference is that this thread is scoped, meaning that it's guaranteed to terminate before the current stack frame goes away, allowing you to reference the parent stack frame directly. This is ensured by having the parent thread join on the child thread before the scope exits.

Generates the base configuration for spawning a scoped thread, from which configuration methods can be chained.

Trait Implementations

impl<'a> Debug for Scope<'a>

Formats the value using the given formatter. Read more

impl<'a> Drop for Scope<'a>

Executes the destructor for this type. Read more

Auto Trait Implementations

impl<'a> !Send for Scope<'a>

impl<'a> !Sync for Scope<'a>