Skip to content

Fix channel waiter race condition#41

Merged
benoitc merged 1 commit intomainfrom
fix/channel-waiter-race
Mar 19, 2026
Merged

Fix channel waiter race condition#41
benoitc merged 1 commit intomainfrom
fix/channel-waiter-race

Conversation

@benoitc
Copy link
Owner

@benoitc benoitc commented Mar 19, 2026

Summary

  • Clear waiter state before releasing mutex, not after dispatch
  • Fixes race where callback fires before channel_send clears has_waiter
  • Prevents spurious waiter_exists errors during fast async iteration

Clear waiter state before releasing mutex, not after dispatch.
With task_ready notification, callback can fire before channel_send
re-acquires mutex to clear has_waiter, causing next wait to fail.
@benoitc benoitc merged commit c8c9738 into main Mar 19, 2026
11 checks passed
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