Repository navigation
feat: add Completion inspection and MutexGuard accessors and clarify future contracts - #449
Merged
Merged
Conversation
8 tasks done
tisonkun
force-pushed
the
feat/wave1-ergonomics-parity
branch
from
November 22, 2026 02:52
9800636 to
f10ee97
Compare
Document that `waitgroup::Wait` and `shutdown::Shutdown` idempotently return `Poll::Ready(())` if polled again after completion, while `oneshot::Recv` is not fused and must not be polled again after returning `Poll::Ready`. Fixes #408
Add lock-free `Completion::get` (`Option<Result<&T, Abandoned>>`) and `Completer::is_disconnected` so callers can inspect settled completion outcomes or check whether all observers have been dropped without waiting.
Expose associated `mutex` accessors on `MutexGuard` and `OwnedMutexGuard` so callers can copy out `&'a Mutex<T>` or clone `&Arc<Mutex<T>>` before moving a guard into a cancellable operation without shadowing methods on `T` via `Deref`. Replace the `condvar`-only internal `guard_lock` and `owned_guard_lock` helpers with these public accessors.
tisonkun
force-pushed
the
feat/wave1-ergonomics-parity
branch
from
November 22, 2026 03:43
f10ee97 to
ebe2d0f
Compare
tisonkun
enabled auto-merge (squash)
November 22, 2026 03:46
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Close out the remaining Wave 1 post-completion future contract documentation and non-blocking inspection ergonomics across three focused commits:
waitgroup::Waitandshutdown::Shutdownidempotently returnPoll::Ready(())when polled again after completion, whileoneshot::Recvis not fused and must not be polled again after returningPoll::Ready(leavingoneshot's runtime state machine untouched).Completioninspection: Expose lock-freeCompletion::get(Option<Result<&T, Abandoned>>) andCompleter::is_disconnectedso callers can inspect settled completion outcomes or check whether all observers have been dropped without waiting.MutexGuard::mutexandOwnedMutexGuard::mutex: Provide associatedmutexaccessors returning&'a Mutex<T>and&Arc<Mutex<T>>without shadowing methods onTviaDeref, replacing thecondvar-only internal helpers and enabling callers to retain a lock reference before moving a guard into a cancellable operation.Fixes #408
Part of #445