Make cpu->proc_run_q_count not atomic

This commit is contained in:
2026-02-22 14:03:51 +01:00
parent 85872b856b
commit e69606668d
4 changed files with 16 additions and 7 deletions

View File

@@ -198,7 +198,7 @@ void proc_register (struct proc* proc, struct cpu* register_cpu, struct reschedu
rbtree_insert (struct proc, &proc_tree, &proc->proc_tree_link, proc_tree_link, pid);
atomic_fetch_add (&cpu->proc_run_q_count, 1);
cpu->proc_run_q_count++;
list_append (cpu->proc_run_q, &proc->cpu_run_q_link);
if (cpu->proc_current == NULL)
cpu->proc_current = proc;
@@ -315,7 +315,7 @@ void proc_kill (struct proc* proc, struct reschedule_ctx* rctx) {
proc->cpu = NULL;
list_remove (cpu->proc_run_q, &proc->cpu_run_q_link);
atomic_fetch_sub (&cpu->proc_run_q_count, 1);
cpu->proc_run_q_count--;
if (cpu->proc_current == proc)
cpu->proc_current = NULL;