parent
ea4fb8ee27
commit
dc411e307a
1 changed files with 2 additions and 8 deletions
|
@ -825,8 +825,6 @@ pub fn park_timeout(dur: Duration) {
|
||||||
/// # Examples
|
/// # Examples
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```
|
||||||
/// #![feature(thread_id)]
|
|
||||||
///
|
|
||||||
/// use std::thread;
|
/// use std::thread;
|
||||||
///
|
///
|
||||||
/// let other_thread = thread::spawn(|| {
|
/// let other_thread = thread::spawn(|| {
|
||||||
|
@ -836,7 +834,7 @@ pub fn park_timeout(dur: Duration) {
|
||||||
/// let other_thread_id = other_thread.join().unwrap();
|
/// let other_thread_id = other_thread.join().unwrap();
|
||||||
/// assert!(thread::current().id() != other_thread_id);
|
/// assert!(thread::current().id() != other_thread_id);
|
||||||
/// ```
|
/// ```
|
||||||
#[unstable(feature = "thread_id", issue = "21507")]
|
#[stable(feature = "thread_id", since = "1.19.0")]
|
||||||
#[derive(Eq, PartialEq, Clone, Copy, Hash, Debug)]
|
#[derive(Eq, PartialEq, Clone, Copy, Hash, Debug)]
|
||||||
pub struct ThreadId(u64);
|
pub struct ThreadId(u64);
|
||||||
|
|
||||||
|
@ -966,8 +964,6 @@ impl Thread {
|
||||||
/// # Examples
|
/// # Examples
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```
|
||||||
/// #![feature(thread_id)]
|
|
||||||
///
|
|
||||||
/// use std::thread;
|
/// use std::thread;
|
||||||
///
|
///
|
||||||
/// let other_thread = thread::spawn(|| {
|
/// let other_thread = thread::spawn(|| {
|
||||||
|
@ -977,7 +973,7 @@ impl Thread {
|
||||||
/// let other_thread_id = other_thread.join().unwrap();
|
/// let other_thread_id = other_thread.join().unwrap();
|
||||||
/// assert!(thread::current().id() != other_thread_id);
|
/// assert!(thread::current().id() != other_thread_id);
|
||||||
/// ```
|
/// ```
|
||||||
#[unstable(feature = "thread_id", issue = "21507")]
|
#[stable(feature = "thread_id", since = "1.19.0")]
|
||||||
pub fn id(&self) -> ThreadId {
|
pub fn id(&self) -> ThreadId {
|
||||||
self.inner.id
|
self.inner.id
|
||||||
}
|
}
|
||||||
|
@ -1168,8 +1164,6 @@ impl<T> JoinHandle<T> {
|
||||||
/// # Examples
|
/// # Examples
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```
|
||||||
/// #![feature(thread_id)]
|
|
||||||
///
|
|
||||||
/// use std::thread;
|
/// use std::thread;
|
||||||
///
|
///
|
||||||
/// let builder = thread::Builder::new();
|
/// let builder = thread::Builder::new();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue