Skip to content

refactor(blocking): avoid PoisonError unwrap branches in parker - #458

Merged
tisonkun merged 1 commit into
mainfrom
refactor/parker-ignore-poison
Nov 23, 2026
Merged

tisonkun merged 1 commit into
mainfrom
refactor/parker-ignore-poison

Conversation

@tisonkun

Copy link
Copy Markdown
Member

Summary

blocking::parker was the last module in asyncband calling .unwrap() directly on std::sync::Mutex and std::sync::Condvar instead of ignoring lock poisoning. Because ParkerState::lock protects no user state and only closes the notification window around Condvar::wait, those Result::unwrap calls emitted unreachable PoisonError formatting and unwinding branches in ParkerState::park and ParkerState::unpark (shrinking both compiled functions by ~14.5% on aarch64).

Switch ParkerState::lock to crate::internal::mutex::Mutex<()> and recover the guard with PoisonError::into_inner on Condvar::{wait, wait_timeout} to match the rest of the crate.

`blocking::parker` was the last module in `asyncband` calling `.unwrap()` directly on `std::sync::Mutex` and `std::sync::Condvar` instead of ignoring lock poisoning. Because `ParkerState::lock` protects no user state and only closes the notification window around `Condvar::wait`, those `Result::unwrap` calls emitted unreachable `PoisonError` formatting and unwinding branches in `ParkerState::park` and `ParkerState::unpark`.

Switch `ParkerState::lock` to `crate::internal::mutex::Mutex<()>` and recover the guard with `PoisonError::into_inner` on `Condvar::{wait, wait_timeout}` to match the rest of the crate.

Signed-off-by: tison <wander4096@gmail.com>
@tisonkun
tisonkun merged commit ece9af2 into main Nov 23, 2026
9 checks passed
@tisonkun
tisonkun deleted the refactor/parker-ignore-poison branch November 23, 2026 00:03
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