Skip to content

Track pending wakeup state in Timer#29

Open
glbrntt wants to merge 1 commit into
apple:mainfrom
glbrntt:timer
Open

Track pending wakeup state in Timer#29
glbrntt wants to merge 1 commit into
apple:mainfrom
glbrntt:timer

Conversation

@glbrntt

@glbrntt glbrntt commented Jun 18, 2026

Copy link
Copy Markdown

Timer's optimisation in 'recalculate' for an already scheduled wakeup applies even if there's no wakeup pending. This can happen when the wakeup is early as an event which would've fallen within the threshold no longer does, so it can remain unscheduled.

Store the kernel wakeup state as an enum: it's either armed for a given time or idle.

Timer's optimisation in 'recalculate' for an already scheduled wakeup
applies even if there's no wakeup pending. This can happen when the
wakeup is early as an event which would've fallen within the threshold
no longer does, so it can remain unscheduled.

Store the kernel wakeup state as an enum: it's either armed for a given
time or idle.
return .zero
}
}
private var wakeup: KernelWakeup = .idle

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Does it make sense to call this "kernel" always? Maybe some other term to indicate it is the actual lower state?

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