mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-06-22 05:30:24 +00:00
hv: fix deadloop in sleep_thread_sync
As we only set BLOCKED status in context switch_out, which means, only running thread can be changed to BLOCKED, but runnable thread can not. This lead to the deadloop in sleep_thread_sync. To solve the problem, in sleep_thread, we set the status to BLOCKED directly when the original thread status is RUNNABLE. Tracked-On: #5115 Signed-off-by: Conghui Chen <conghui.chen@intel.com>
This commit is contained in:
parent
f6e978c795
commit
d531e84d32
@ -203,8 +203,10 @@ void sleep_thread(struct thread_object *obj)
|
|||||||
} else {
|
} else {
|
||||||
make_reschedule_request(pcpu_id, DEL_MODE_IPI);
|
make_reschedule_request(pcpu_id, DEL_MODE_IPI);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
obj->be_blocking = true;
|
obj->be_blocking = true;
|
||||||
|
} else {
|
||||||
|
set_thread_status(obj, THREAD_STS_BLOCKED);
|
||||||
|
}
|
||||||
release_schedule_lock(pcpu_id, rflag);
|
release_schedule_lock(pcpu_id, rflag);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user