-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
[DOC] Improve thread::panicking
documentaion.
#41811
Conversation
thread::panicking
documentaion.thread::panicking
documentaion.
src/libstd/thread/mod.rs
Outdated
/// 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. |
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.
[00:02:03] tidy error: /checkout/src/libstd/thread/mod.rs:465: trailing whitespace
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.
Damn, that is valid mardown though T_T.
Will remove them
src/libstd/thread/mod.rs
Outdated
@@ -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 |
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.
resources
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.
done
src/libstd/thread/mod.rs
Outdated
/// 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] |
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.
Mutexes ?
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.
done
src/libstd/thread/mod.rs
Outdated
/// 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. |
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.
themselves; panicks
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.
done
0fcc053
to
12efc9d
Compare
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 |
📌 Commit 12efc9d has been approved by |
[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
☀️ Test successful - status-appveyor, status-travis |
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