scheduler: a bunch of fixes and a few changes

transferred memory context from proc to thread, fixed bugs relating to blocking, made getnext() wait till something is ready to run
This commit is contained in:
Matheus
2022-09-09 18:18:22 -03:00
parent 511c249b13
commit 2848544ff0
2 changed files with 79 additions and 35 deletions
+2 -1
View File
@@ -34,6 +34,7 @@ typedef struct _thread_t{
void* kernelstack;
void* kernelstackbase;
size_t stacksize;
vmm_context* ctx;
pid_t tid;
int priority;
} thread_t;
@@ -49,7 +50,6 @@ typedef struct _proc_t{
int fdlock;
size_t fdcount;
off_t firstfreefd;
vmm_context* context;
thread_t** threads;
size_t threadcount;
dirnode_t* root;
@@ -63,6 +63,7 @@ typedef struct{
int lock;
} sched_queue;
thread_t* sched_newkthread(void* ip, size_t stacksize, bool run, int prio);
void sched_init();
void sched_runinit();
void sched_eventsignal(event_t* event, thread_t* thread);