Add unblock_no_ipi function and use in context switch
This commit is contained in:
@@ -294,10 +294,7 @@ impl Context {
|
||||
|
||||
/// Unblock context, and return true if it was blocked before being marked runnable
|
||||
pub fn unblock(&mut self) -> bool {
|
||||
if self.status.is_soft_blocked() {
|
||||
self.status = Status::Runnable;
|
||||
self.status_reason = "";
|
||||
|
||||
if self.unblock_no_ipi() {
|
||||
if let Some(cpu_id) = self.cpu_id {
|
||||
if cpu_id != crate::cpu_id() {
|
||||
// Send IPI if not on current CPU
|
||||
|
||||
@@ -60,12 +60,12 @@ unsafe fn update_runnable(context: &mut Context, cpu_id: LogicalCpuId) -> bool {
|
||||
regs.set_singlestep(was_singlestep);
|
||||
}
|
||||
|
||||
context.unblock();
|
||||
context.unblock_no_ipi();
|
||||
}
|
||||
|
||||
// Unblock when there are pending signals
|
||||
if context.status.is_soft_blocked() && !context.pending.is_empty() {
|
||||
context.unblock();
|
||||
context.unblock_no_ipi();
|
||||
}
|
||||
|
||||
// Wake from sleep
|
||||
@@ -75,7 +75,7 @@ unsafe fn update_runnable(context: &mut Context, cpu_id: LogicalCpuId) -> bool {
|
||||
let current = time::monotonic();
|
||||
if current >= wake {
|
||||
context.wake = None;
|
||||
context.unblock();
|
||||
context.unblock_no_ipi();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user