Content-Length: 7181 | pFad | https://doc.rust-lang.org/reference/../std/../std/vec/../cmp/../thread/fn.current.html

current in std::thread - Rust

current

Function current 

1.0.0 · Source
pub fn current() -> Thread
Expand description

Gets a handle to the thread that invokes it.

§Examples

Getting a handle to the current thread with thread::current():

use std::thread;

let handler = thread::Builder::new()
    .name("named thread".into())
    .spawn(|| {
        let handle = thread::current();
        assert_eq!(handle.name(), Some("named thread"));
    })
    .unwrap();

handler.join().unwrap();








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://doc.rust-lang.org/reference/../std/../std/vec/../cmp/../thread/fn.current.html

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy