hv: remove 'running' from vcpu structure

vcpu->running is duplicated with THREAD_STS_RUNNING status of thread
object. Introduce an API sleep_thread_sync(), which can utilize the
inner status of thread object, to do the sync sleep for zombie_vcpu().

Tracked-On: #5057
Signed-off-by: Conghui Chen <conghui.chen@intel.com>
Reviewed-by: Shuo A Liu <shuo.a.liu@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
Conghui Chen
2020-07-17 23:53:43 +08:00
committed by wenlingz
parent 2abbb99f6a
commit b6422f8985
4 changed files with 13 additions and 11 deletions

View File

@@ -213,6 +213,14 @@ void sleep_thread(struct thread_object *obj)
release_schedule_lock(pcpu_id, rflag);
}
void sleep_thread_sync(struct thread_object *obj)
{
sleep_thread(obj);
while (!is_blocked(obj)) {
asm_pause();
}
}
void wake_thread(struct thread_object *obj)
{
uint16_t pcpu_id = obj->pcpu_id;