scheduler: begin rework

This commit is contained in:
Matheus
2025-08-19 00:44:14 -03:00
parent c10bebb9ef
commit 5098c09f26
7 changed files with 97 additions and 0 deletions
+2
View File
@@ -43,6 +43,8 @@ thread_t *sched_newthread(void *ip, size_t kstacksize, int priority, proc_t *pro
SPINLOCK_INIT(thread->sleeplock);
SPINLOCK_INIT(thread->signals.lock);
EVENT_INITHEADER(&thread->signals.waitpendingevent);
memset(&thread->metrics, 0, sizeof(thread->metrics));
thread->metrics.sleep_time_avg_us = 1; // to prevent a division by 0 when the thread first gets scheduled
return thread;
}