git://scm.lunaixsky.com
/
lunaix-os.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Boot framework rework (#45)
[lunaix-os.git]
/
lunaix-os
/
kernel
/
process
/
sched.c
diff --git
a/lunaix-os/kernel/process/sched.c
b/lunaix-os/kernel/process/sched.c
index 574d593a0db86c0960b5bfd50a830a80206c2c2c..945fc01bf6db0a8ae5edb1fcc48f867732fb3cbd 100644
(file)
--- a/
lunaix-os/kernel/process/sched.c
+++ b/
lunaix-os/kernel/process/sched.c
@@
-73,10
+73,9
@@
run(struct thread* thread)
clean-up on these thread, in the preemptible kernel thread.
*/
clean-up on these thread, in the preemptible kernel thread.
*/
-void _preemptible
-cleanup_detached_threads() {
- ensure_preempt_caller();
-
+void
+cleanup_detached_threads()
+{
// XXX may be a lock on sched_context will ben the most appropriate?
cpu_disable_interrupt();
// XXX may be a lock on sched_context will ben the most appropriate?
cpu_disable_interrupt();
@@
-550,7
+549,7
@@
delete_process(struct proc_info* proc)
pid_t
destroy_process(pid_t pid)
pid_t
destroy_process(pid_t pid)
-{
+{
int index = pid;
if (index <= 0 || index > sched_ctx.ptable_len) {
syscall_result(EINVAL);
int index = pid;
if (index <= 0 || index > sched_ctx.ptable_len) {
syscall_result(EINVAL);
@@
-565,6
+564,8
@@
destroy_process(pid_t pid)
static void
terminate_proc_only(struct proc_info* proc, int exit_code) {
static void
terminate_proc_only(struct proc_info* proc, int exit_code) {
+ assert(proc->pid != 0);
+
proc->state = PS_TERMNAT;
proc->exit_code = exit_code;
proc->state = PS_TERMNAT;
proc->exit_code = exit_code;
@@
-598,7
+599,7
@@
terminate_proccess(struct proc_info* proc, int exit_code) {
terminate_proc_only(proc, exit_code);
struct thread *pos, *n;
terminate_proc_only(proc, exit_code);
struct thread *pos, *n;
- llist_for_each(pos, n, &
__current
->threads, proc_sibs) {
+ llist_for_each(pos, n, &
proc
->threads, proc_sibs) {
pos->state = PS_TERMNAT;
}
}
pos->state = PS_TERMNAT;
}
}