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

io: use Mutex instead of spinlock #6403

Merged
merged 2 commits into from Mar 16, 2024

Conversation

maminrayej
Copy link
Member

This PR replaces the spinlock behavior of poll functions of io::ReadHalf and io::WriteHalf with a blocking Mutex. Since poll functions are supposed to finish quickly, it's okay to use a blocking Mutex.

Resolves #6396.

@maminrayej maminrayej added A-tokio Area: The main tokio crate M-io Module: tokio/io labels Mar 14, 2024
tokio/src/io/split.rs Outdated Show resolved Hide resolved
Copy link
Member

@mox692 mox692 left a comment

Choose a reason for hiding this comment

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

Looks good to me.

@maminrayej maminrayej merged commit b2896fe into tokio-rs:master Mar 16, 2024
75 checks passed
@Frostie314159
Copy link

Thanks for the quick fix!

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-io Module: tokio/io
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Awaiting Read and Write Half concurrently causes spin lock.
4 participants