if (wtime && now >= wtime) {
pos->sleep.wakeup_time = 0;
- pos->state = PS_STOPPED;
+ pos->state = PS_READY;
}
if (atime && now >= atime) {
int ptr = prev_ptr;
if (!(__current->state & ~PS_RUNNING)) {
- __current->state = PS_STOPPED;
+ __current->state = PS_READY;
}
check_sleepers();
do {
ptr = (ptr + 1) % sched_ctx.ptable_len;
next = &sched_ctx._procs[ptr];
- } while (next->state != PS_STOPPED && ptr != prev_ptr);
+ } while (next->state != PS_READY && ptr != prev_ptr);
sched_ctx.procs_index = ptr;
void
sched_yieldk()
{
+ cpu_enable_interrupt();
cpu_int(LUNAIX_SCHED);
}
status_flags |= PEXITTERM;
goto done;
}
- if (proc->state == PS_STOPPED && (options & WUNTRACED)) {
+ if (proc->state == PS_READY && (options & WUNTRACED)) {
status_flags |= PEXITSTOP;
goto done;
}
llist_init_head(&proc->children);
llist_init_head(&proc->grp_member);
llist_init_head(&proc->sleep.sleepers);
+ waitq_init(&proc->waitqueue);
return proc;
}
llist_append(&process->parent->children, &process->siblings);
- process->state = PS_STOPPED;
+ process->state = PS_READY;
}
// from <kernel/process.c>