mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-10-28 21:28:21 +00:00
initial signal implementation
This commit is contained in:
@@ -8,12 +8,12 @@
|
||||
__attribute__((noreturn)) void syscall_exit(context_t *context, int status) {
|
||||
thread_t *thread = _cpu()->thread;
|
||||
proc_t *proc = thread->proc;
|
||||
__assert(proc != sched_initproc);
|
||||
__assert(spinlock_try(&proc->exiting)); // only one thread can exit at the same time
|
||||
if (spinlock_try(&proc->exiting) == false)
|
||||
sched_threadexit();
|
||||
|
||||
sched_stopotherthreads();
|
||||
|
||||
proc->status = status;
|
||||
proc->status = status << 8;
|
||||
|
||||
sched_threadexit();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user