Conversation
|
r? @joboet rustbot has assigned @joboet. Use Why was this reviewer chosen?The reviewer was selected based on:
|
| /// Returns `true` when the channel is disconnected. | ||
| pub(crate) fn is_disconnected(&self) -> bool { | ||
| self.inner.lock().is_disconnected | ||
| } |
There was a problem hiding this comment.
It's somewhat unfortunate that this has to take the lock. I believe it might be possible to outline the is_disconnected flag as an atomic bool outside of the lock, but that might not be worth the extra complexity.
|
Reminder, once the PR becomes ready for a review, use |
|
r? libs-api |
f7f38a6 to
784f112
Compare
This comment has been minimized.
This comment has been minimized.
|
@rustbot ready |
This comment has been minimized.
This comment has been minimized.
Adds an `is_ready` method to `oneshot::Receiver` that allows a user to see if a value has been sent over the channel. Signed-off-by: Connor Tsui <connor.tsui20@gmail.com>
Signed-off-by: Connor Tsui <connor.tsui20@gmail.com>
784f112 to
638bbeb
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
Tracking Issue: #143674
Adds a
is_readymethod to theoneshot::Receiver.This also changes the internal mutex for the
mpmc::zeroflavor implementation to use thenonpoison::Mutexsince every lock call simplyunwraps. Please let me know if that is out of the scope of this change.There's also one small unfortunate implementation detail, see comments below.