Skip to content

aaudio: Make shutdown_with_error non-blocking.#838

Merged
kinetiknz merged 1 commit into
masterfrom
aaudio_state_deadlock
Mar 23, 2026
Merged

aaudio: Make shutdown_with_error non-blocking.#838
kinetiknz merged 1 commit into
masterfrom
aaudio_state_deadlock

Conversation

@kinetiknz
Copy link
Copy Markdown
Collaborator

shutdown_with_error would block the state thread, preventing other streams from receiving updates. Instead, poll stream states and return early if a terminal state has not yet been reached. Make ERROR a waiting state so the state thread calls shutdown_with_error repeatedly to drive it to completion.

Also adjust shutdown_with_error to handle a concurrent stream_stop causing the stream's terminal state to become PAUSED instead of the expected STOPPED.

This significantly reduces the number of test timeouts observed in BMO 1988591.

@kinetiknz kinetiknz requested review from Pehrsons and padenot March 23, 2026 07:10
@kinetiknz kinetiknz self-assigned this Mar 23, 2026
shutdown_with_error would block the state thread, preventing other
streams from receiving updates.  Instead, poll stream states and return
early if a terminal state has not yet been reached.  Make ERROR a
waiting state so the state thread calls shutdown_with_error repeatedly
to drive it to completion.

Also adjust shutdown_with_error to handle a concurrent stream_stop
causing the stream's terminal state to become PAUSED instead of the
expected STOPPED.
@kinetiknz kinetiknz force-pushed the aaudio_state_deadlock branch from 8490e7a to 456cc4d Compare March 23, 2026 07:12
Copy link
Copy Markdown
Contributor

@Pehrsons Pehrsons left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense, thanks.

@kinetiknz kinetiknz merged commit 38ad36c into master Mar 23, 2026
31 checks passed
@kinetiknz kinetiknz deleted the aaudio_state_deadlock branch March 23, 2026 18:53
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.

2 participants