Skip to content

Zig: Fix RunAfter behavior on device suspension - #532

Merged
keeshux merged 2 commits into
masterfrom
bugfix/zig-run-after
Jul 26, 2026
Merged

Zig: Fix RunAfter behavior on device suspension#532
keeshux merged 2 commits into
masterfrom
bugfix/zig-run-after

Conversation

@keeshux

@keeshux keeshux commented Jul 26, 2026

Copy link
Copy Markdown
Member

Rather than polling every 10ms:

  • First, use absolute deadlines rather than deltas
  • Schedule wake-up at the next earliest callback deadline
  • If a new callback is scheduled earlier, interrupt the pending wake-up and reschedule with the new deadline

For this to work, replace the naïve sleepMs() spin-lock with platform-specific waitUntil() conditions.

@keeshux keeshux self-assigned this Jul 26, 2026
@keeshux keeshux added the bug Something isn't working label Jul 26, 2026
@keeshux keeshux added this to the Rewrite in Zig (pt1) milestone Jul 26, 2026
@keeshux keeshux changed the title Zig: Fix RunAfter behavior on device sleep Zig: Fix RunAfter behavior on device suspension Jul 26, 2026
@keeshux
keeshux merged commit ae3b07c into master Jul 26, 2026
2 checks passed
@keeshux
keeshux deleted the bugfix/zig-run-after branch July 26, 2026 21:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant