mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-11-01 23:18:21 +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_getcwd();
|
||||||
vnode_t *sched_getroot();
|
vnode_t *sched_getroot();
|
||||||
thread_t *sched_newthread(void *ip, size_t kstacksize, int priority, proc_t *proc, void *ustack);
|
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
|
#endif
|
||||||
|
|||||||
@@ -40,7 +40,9 @@ proc_t *sched_newproc() {
|
|||||||
slab_free(processcache, proc);
|
slab_free(processcache, proc);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO move this to slab
|
// TODO move this to slab
|
||||||
|
proc->state = SCHED_PROC_STATE_NORMAL;
|
||||||
proc->threadtablesize = 1;
|
proc->threadtablesize = 1;
|
||||||
proc->runningthreadcount = 1;
|
proc->runningthreadcount = 1;
|
||||||
SPINLOCK_INIT(proc->lock);
|
SPINLOCK_INIT(proc->lock);
|
||||||
@@ -97,9 +99,9 @@ void sched_destroythread(thread_t *thread) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void sched_destroyproc(proc_t *proc) {
|
void sched_destroyproc(proc_t *proc) {
|
||||||
//free(proc->threads);
|
free(proc->threads);
|
||||||
//free(proc->fd);
|
free(proc->fd);
|
||||||
//slab_free(processcache, proc);
|
slab_free(processcache, proc);
|
||||||
}
|
}
|
||||||
|
|
||||||
static thread_t *runqueuenext(int minprio) {
|
static thread_t *runqueuenext(int minprio) {
|
||||||
|
|||||||
Reference in New Issue
Block a user