mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-10-27 12:48:22 +00:00
scheduler: fix newproc() unitialized variable
This commit is contained in:
@@ -82,6 +82,7 @@ proc_t *sched_newproc();
|
||||
vnode_t *sched_getcwd();
|
||||
vnode_t *sched_getroot();
|
||||
thread_t *sched_newthread(void *ip, size_t kstacksize, int priority, proc_t *proc, void *ustack);
|
||||
|
||||
void sched_destroyproc(proc_t *);
|
||||
void sched_destroythread(thread_t *);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -40,7 +40,9 @@ proc_t *sched_newproc() {
|
||||
slab_free(processcache, proc);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// TODO move this to slab
|
||||
proc->state = SCHED_PROC_STATE_NORMAL;
|
||||
proc->threadtablesize = 1;
|
||||
proc->runningthreadcount = 1;
|
||||
SPINLOCK_INIT(proc->lock);
|
||||
@@ -97,9 +99,9 @@ void sched_destroythread(thread_t *thread) {
|
||||
}
|
||||
|
||||
void sched_destroyproc(proc_t *proc) {
|
||||
//free(proc->threads);
|
||||
//free(proc->fd);
|
||||
//slab_free(processcache, proc);
|
||||
free(proc->threads);
|
||||
free(proc->fd);
|
||||
slab_free(processcache, proc);
|
||||
}
|
||||
|
||||
static thread_t *runqueuenext(int minprio) {
|
||||
|
||||
Reference in New Issue
Block a user