Skip to content
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

Merged
merged 1 commit into from Jan 2, 2017

Conversation

GuillaumeGomez
Copy link
Member

@GuillaumeGomez GuillaumeGomez commented Dec 22, 2016

@frewsxcv
Copy link
Member

Travis found some issues.

/// .unwrap();
///
/// handler.join().unwrap();
/// ```
Copy link
Member

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?

Copy link
Member Author

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();
/// ```
Copy link
Member

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?

Copy link
Member Author

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... :-/

@GuillaumeGomez
Copy link
Member Author

Updated.

/// use std::thread;
///
/// let handler = thread::Builder::new()
/// .name("foo".into());
Copy link
Member

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());
Copy link
Member

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

@GuillaumeGomez
Copy link
Member Author

Updated.

@frewsxcv
Copy link
Member

frewsxcv commented Jan 1, 2017

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Jan 1, 2017

📌 Commit 3312feb has been approved by frewsxcv

@bors
Copy link
Contributor

bors commented Jan 1, 2017

⌛ Testing commit 3312feb with merge 07191e2...

bors added a commit that referenced this pull request Jan 1, 2017
@bors
Copy link
Contributor

bors commented Jan 2, 2017

☀️ Test successful - status-appveyor, status-travis
Approved by: frewsxcv
Pushing 07191e2 to master...

@bors bors merged commit 3312feb into rust-lang:master Jan 2, 2017
@GuillaumeGomez GuillaumeGomez deleted the thread_struct_docs branch January 2, 2017 10:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants