Skip to content

Split spin_wait into std and no_std versions - #18

Merged
droundy merged 1 commit into
no-stdfrom
simplify-spin-wait
Oct 18, 2026
Merged

droundy merged 1 commit into
no-stdfrom
simplify-spin-wait

Conversation

@droundy

@droundy droundy commented Oct 18, 2026

Copy link
Copy Markdown
Owner

Stacked on #16.

spin_wait mixed three mechanisms: a runtime cfg! in the if, a #[cfg] on yield_now that leaves an empty else without std, and a .min(3) that does nothing on the std path. This defines it once for each configuration:

No behavior change. cargo test passes with and without default features, and thumbv6m-none-eabi with portable-atomic still checks.

🤖 Generated with Claude Code

Instead of one function that mixes cfg! in its condition, a cfg
attribute on the yield, and a min(3) that only the no_std path needs,
define spin_wait once for each configuration.  Behavior is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@droundy
droundy merged commit 1b9a3df into no-std Oct 18, 2026
20 of 22 checks passed
@droundy droundy mentioned this pull request Oct 18, 2026
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