You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(wait): call unlock_cpu_and_check_preemption after timeout expiration
It's necessary to call `unlock_cpu_and_check_preemption` after waking up
a task. For timed wake-ups, there are two possible places to do this:
1. The timeout callback function `interrupt_task_by_timeout` (defined
in `wait.rs`). However, `unlock_cpu_and_check_preemption` takes the
ownership of CPU Lock and the convention of timeout callback
functions requires that they enter and leave with CPU Lock active,
so this function would have to re-acquire CPU Lock before returning.
2. The tick handler, `handle_tick` (defined in `timeout.rs`). It
already releases CPU Lock, so this option doesn't have the CPU Lock
issue. This option may cause redundant calls to
`unlock_cpu_and_check_preemption`, but those won't happen too often
because timeout objects are expected to be used to wake up tasks for
most of the times.
This commit implements the second option.
0 commit comments