Skip to content

refactor(condvar): simplify waiter state and notification handoff - #348

Merged
tisonkun merged 1 commit into
mainfrom
codex/deslopify-condvar-waiters
Oct 3, 2026
Merged

tisonkun merged 1 commit into
mainfrom
codex/deslopify-condvar-waiters

Conversation

@tisonkun

@tisonkun tisonkun commented Oct 3, 2026

Copy link
Copy Markdown
Member

Summary

Store WaitState directly in the condition variable's wait list, removing the single-field WaitNode wrapper. Read the returned or removed state to extract a waker and decide notification handoff, following the existing notify_all path instead of mutating auxiliary variables from unlink predicates. Waker destruction and wake callbacks remain outside the waiter lock.

Extend the existing notify_one cancellation tests to cover cancellation before repolling a selected waiter as well as while reacquiring its mutex, both with and without a successor. Public behavior is unchanged.

Validation: cargo x test (618 passed), cargo x check (26 feature configurations), and cargo x lint.

Store WaitState directly in the wait list. Use the returned or removed
state instead of mutating auxiliary variables from unlink predicates,
following the existing notify_all path.

Keep registration before mutex release and waker destruction and wake
callbacks outside the waiter lock. Extend the existing cancellation tests
to cover both before repolling a selected waiter and while reacquiring
its mutex, with and without a successor.
@tisonkun
tisonkun merged commit 4eedbcc into main Oct 3, 2026
9 checks passed
@tisonkun
tisonkun deleted the codex/deslopify-condvar-waiters branch October 3, 2026 16:13
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.

1 participant