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

(minor) amendments to Mutex docs #3645

Merged
merged 4 commits into from Mar 27, 2021
Merged

(minor) amendments to Mutex docs #3645

merged 4 commits into from Mar 27, 2021

Conversation

CorinJG
Copy link
Contributor

@CorinJG CorinJG commented Mar 25, 2021

Motivation

The opening lines of the current documentation for tokio::sync::Mutex could be interpreted to imply std::sync::Mutex cannot be held across any .await points, which isn't the case.

Solution

Attempted to keep reasonably concise but allude to fact that not all .await points are equal in terms of bounds required.

To be more correct about fact that std Mutex can also be held across _some_ .await points
@CorinJG CorinJG marked this pull request as ready for review March 25, 2021 20:00
tokio/src/sync/mutex.rs Outdated Show resolved Hide resolved
@Darksonn Darksonn added A-tokio Area: The main tokio crate M-sync Module: tokio/sync T-docs Topic: documentation labels Mar 25, 2021
Minor edits for improved readability. Introduced an extra paragraph under 'Which kind of mutex should you use?' explicitly warning against holding std Mutex across .await points even though it's possible in some situations.
Copy link
Contributor

@Darksonn Darksonn left a comment

Choose a reason for hiding this comment

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

Thanks, the new edits are much better!

tokio/src/sync/mutex.rs Outdated Show resolved Hide resolved
tokio/src/sync/mutex.rs Outdated Show resolved Hide resolved
tokio/src/sync/mutex.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@Darksonn Darksonn left a comment

Choose a reason for hiding this comment

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

Thanks.

@Darksonn Darksonn merged commit 1a80d6e into tokio-rs:master Mar 27, 2021
@Darksonn Darksonn mentioned this pull request Apr 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-tokio Area: The main tokio crate M-sync Module: tokio/sync T-docs Topic: documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants