New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add missing example for Thread struct #38548
Conversation
Travis found some issues. |
/// .unwrap(); | ||
/// | ||
/// handler.join().unwrap(); | ||
/// ``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is Thread
used in this example?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the spawn
closure.
/// .unwrap(); | ||
/// | ||
/// handler.join().unwrap(); | ||
/// ``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is unpark
doing in this example?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not much, I really wonder how to show such an example of usage actually... :-/
ab1275f
to
3372d9c
Compare
Updated. |
/// use std::thread; | ||
/// | ||
/// let handler = thread::Builder::new() | ||
/// .name("foo".into()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Semicolon
/// let handler = thread::Builder::new() | ||
/// .spawn(|| { | ||
/// let thread = thread::current(); | ||
/// println!("thread id: {}", thread.id()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ThreadId
does not implement Display
3372d9c
to
3312feb
Compare
Updated. |
@bors r+ rollup |
📌 Commit 3312feb has been approved by |
Add missing example for Thread struct r? @frewsxcv
☀️ Test successful - status-appveyor, status-travis |
r? @frewsxcv