On 9/20/21 2:44 PM, Philippe Mathieu-Daudé wrote:
-    g_assert(cc->has_work);
-    return cc->has_work(cpu);
+    if (cc->has_work) {
+        return cc->has_work(cpu);
+    }
+    if (cpus_accel->has_work) {
+        return cpus_accel->has_work(cpu);
+    }
+    g_assert_not_reached();

This might be close to the end result, but it isn't what we begin with in 
cpu_thread_is_idle.

You'd want

    if (cc->has_work && cc->has_work(cpu)) {
        return true;
    }
    if (cpus_accel->has_work && cpus_accel->has_work(cpu)) {
        return true;
    }
    return false;

to start. After the cpus_accel hook is filled in you can assert and return from cpus_accel->has_work. And of course after cc->has_work is removed, that clause is gone.


r~

Reply via email to