Skip to content

Conversation

gamazeps
Copy link
Contributor

@gamazeps gamazeps commented May 7, 2017

Part of #29378

Takes care of: panicking could use some more advice on when to use this.

I mays have done a poor choice of introducing Mutexs.

r? @steveklabnik

@gamazeps gamazeps changed the title mprove thread::panicking documentaion. [DOC] Improve thread::panicking documentaion. May 7, 2017
/// unsafe code, by checking `panicking` when the `drop` is called.
///
/// This is usually not needed when writing safe code, as [`Mutex`s][Mutex]
/// already poison themselve when a thread panicks while holding the lock.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[00:02:03] tidy error: /checkout/src/libstd/thread/mod.rs:465: trailing whitespace

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Damn, that is valid mardown though T_T.

Will remove them

@frewsxcv frewsxcv added the A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools label May 7, 2017
@@ -458,6 +458,16 @@ pub fn yield_now() {

/// Determines whether the current thread is unwinding because of panic.
///
/// A common use of this feature is to poison shared ressources when writing
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resources

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

/// A common use of this feature is to poison shared ressources when writing
/// unsafe code, by checking `panicking` when the `drop` is called.
///
/// This is usually not needed when writing safe code, as [`Mutex`s][Mutex]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mutexes ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

/// unsafe code, by checking `panicking` when the `drop` is called.
///
/// This is usually not needed when writing safe code, as [`Mutex`s][Mutex]
/// already poison themselve when a thread panicks while holding the lock.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

themselves; panicks

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@gamazeps gamazeps force-pushed the thread-panicking-doc branch from 0fcc053 to 12efc9d Compare May 7, 2017 16:40
@frewsxcv
Copy link
Contributor

frewsxcv commented May 7, 2017

this is a great improvement, thanks so much for this! always love to see the api docs expanded describing various use cases of the functionality 👌

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented May 7, 2017

📌 Commit 12efc9d has been approved by frewsxcv

@bors
Copy link
Collaborator

bors commented May 7, 2017

⌛ Testing commit 12efc9d with merge d985625...

bors added a commit that referenced this pull request May 7, 2017
[DOC] Improve `thread::panicking` documentaion.

Part of #29378

Takes care of: `panicking` could use some more advice on when to use this.

I mays have done a poor choice of introducing `Mutex`s.

r? @steveklabnik
@bors
Copy link
Collaborator

bors commented May 7, 2017

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

@bors bors merged commit 12efc9d into rust-lang:master May 7, 2017
@gamazeps gamazeps deleted the thread-panicking-doc branch May 13, 2017 17:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants