-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
docs: Clarify FIFO Behavior of tokio::sync::Mutex #6279
Conversation
Signed-off-by: azuredream <[email protected]>
Signed-off-by: azuredream <[email protected]>
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.
Thanks, a few suggestions.
tokio/src/sync/mutex.rs
Outdated
@@ -17,6 +17,11 @@ use std::{fmt, mem, ptr}; | |||
/// differences: [`lock`] is an async method so does not block, and the lock | |||
/// guard is designed to be held across `.await` points. | |||
/// | |||
/// Please note that Tokio's Mutex operates on a guaranteed FIFO basis. |
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.
This is redundant.
/// Please note that Tokio's Mutex operates on a guaranteed FIFO basis. | |
/// Tokio's Mutex operates on a guaranteed FIFO basis. |
tokio/src/sync/mutex.rs
Outdated
/// Please note that Tokio's Mutex operates on a guaranteed FIFO basis. | ||
/// This means that the order in which tasks call the [`lock`] method is | ||
/// the exact order in which they will acquire the lock. | ||
/// We commit to maintaining this behavior in future versions. |
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.
This is generally implicit, so it's redundant to include it.
/// We commit to maintaining this behavior in future versions. |
Signed-off-by: azuredream <[email protected]>
Updated. Thanks for your review! |
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.
Thank you.
Closes: #6278