fix wrong calculation of active tasks
This commit is contained in:
parent
5ec1a4e98e
commit
f6a5f75725
1 changed files with 3 additions and 3 deletions
|
@ -124,14 +124,14 @@ static void NORETURN do_exit(int arg)
|
||||||
|
|
||||||
page_map_drop();
|
page_map_drop();
|
||||||
|
|
||||||
curr_task->status = TASK_FINISHED;
|
|
||||||
reschedule();
|
|
||||||
|
|
||||||
// decrease the number of active tasks
|
// decrease the number of active tasks
|
||||||
spinlock_irqsave_lock(&readyqueues.lock);
|
spinlock_irqsave_lock(&readyqueues.lock);
|
||||||
readyqueues.nr_tasks--;
|
readyqueues.nr_tasks--;
|
||||||
spinlock_irqsave_unlock(&readyqueues.lock);
|
spinlock_irqsave_unlock(&readyqueues.lock);
|
||||||
|
|
||||||
|
curr_task->status = TASK_FINISHED;
|
||||||
|
reschedule();
|
||||||
|
|
||||||
kprintf("Kernel panic: scheduler found no valid task\n");
|
kprintf("Kernel panic: scheduler found no valid task\n");
|
||||||
while(1) {
|
while(1) {
|
||||||
HALT;
|
HALT;
|
||||||
|
|
Loading…
Add table
Reference in a new issue