13 auto& cpu_sched = GetCurrentCpuSched();
18 auto it = cpu_sched.blocked_tasks.find(resource_id);
20 if (it == cpu_sched.blocked_tasks.end()) {
22 klog::Debug(
"Wakeup: No tasks waiting on resource={}, data={:#x}",
23 resource_id.GetTypeName(),
24 static_cast<uint64_t
>(resource_id.GetData()));
29 auto& waiting_tasks = it->second;
30 size_t wakeup_count = 0;
32 while (!waiting_tasks.empty()) {
33 auto* task = waiting_tasks.front();
34 waiting_tasks.pop_front();
37 "Wakeup: task status must be kBlocked");
38 assert(task->aux->blocked_on == resource_id &&
39 "Wakeup: task blocked_on must match resource_id");
47 cpu_sched.schedulers[
static_cast<uint8_t
>(task->policy)].get();
48 assert(scheduler !=
nullptr &&
"Wakeup: scheduler must not be null");
49 scheduler->Enqueue(task);
54 cpu_sched.blocked_tasks.erase(resource_id);
56 klog::Debug(
"Wakeup: Woke up {} tasks from resource={}, data={:#x}",
57 wakeup_count, resource_id.GetTypeName(),
58 static_cast<uint64_t
>(resource_id.GetData()));