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

Keep lock until sender notified #2302

Merged
merged 1 commit into from
Mar 9, 2020
Merged

Keep lock until sender notified #2302

merged 1 commit into from
Mar 9, 2020

Conversation

th0114nd
Copy link
Contributor

@th0114nd th0114nd commented Mar 8, 2020

Motivation

https://rust-lang.github.io/rust-clippy/master/index.html#let_underscore_lock

Solution

Binding the tail's lock keeps it acquired until notify_all is called

Copy link
Contributor

@Matthias247 Matthias247 left a comment

Choose a reason for hiding this comment

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

Makes sense. Thanks!

@Matthias247 Matthias247 merged commit 826fc21 into tokio-rs:master Mar 9, 2020
sthagen added a commit to sthagen/tokio-rs-tokio that referenced this pull request Mar 9, 2020
Keep lock until sender notified (tokio-rs#2302)
@carllerche
Copy link
Member

This was intentional. Holding the lock while notifying is unnecessary. If you believe it is a bug, we should isolate it with a look test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants