waitpid: use event instead of busy loop when waiting for threads to die

This commit is contained in:
Matheus
2026-04-16 22:41:43 -03:00
parent 4e3c41df39
commit 3dfb6b5a8c
4 changed files with 27 additions and 6 deletions
+2
View File
@@ -70,6 +70,8 @@ static void threadexit_internal(context_t *, void *) {
current_cpu()->thread = NULL;
thread->flags |= THREAD_FLAGS_DEAD;
if (thread->proc)
EVENT_SIGNAL(&thread->proc->thread_exit_event);
// because a thread deallocating its own data is a nightmare, thread deallocation and such will be left to whoever frees the proc it's tied to
// (likely an exit(2) call)