-
-
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
sync: add_permits does not panic with usize::MAX >> 3 #3188
Conversation
0692831
to
447d2b1
Compare
Fixed incorrect shift in the assignment of permits on batch_semaphore.rs Fixes: tokio-rs#3095
Can someone who knows the implementation of let prev = self.permits.fetch_add(rem << Self::PERMIT_SHIFT, Release); It's just outside the area I can select with the diff tool. |
My guess is that that line is correct. |
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 looks correct to me!
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 also seems correct to me now.
Fixed incorrect shift in the assignment of permits on batch_semaphore.rs
Fixes: #3095