rstd 0.1.0
Loading...
Searching...
No Matches
rstd::thread::ThreadId Class Referenceexport
module rstd

A unique identifier for a running thread. More...

Public Member Functions

constexpr auto as_u64 () const noexcept
 Unstable in Rust: thread_id_value
 

Static Public Member Functions

static ThreadId make ()
 Generates a new unique thread ID using an atomic counter.
 
static constexpr auto from_u64 (value_type v) noexcept -> Option< ThreadId >
 Attempts to construct a ThreadId from a raw u64 value.
 

Detailed Description

A unique identifier for a running thread.

ThreadId is an opaque object that uniquely identifies each thread created during the lifetime of a process. IDs are guaranteed not to be reused. (No promise about relation to OS thread IDs.)

Member Function Documentation

◆ from_u64()

static constexpr auto rstd::thread::ThreadId::from_u64 ( value_type v) -> Option<ThreadId>
inlinestaticconstexprnoexcept

Attempts to construct a ThreadId from a raw u64 value.

Parameters
vThe raw identifier value; must be non-zero.
Returns
Some(ThreadId) if v is non-zero, None otherwise.

The documentation for this class was generated from the following file: