Fix thread status race-condition caused by hold_thread() in do_kill() and terminate()

Conflicts:
	arch/x86_64/kernel/syscall.c
	kernel/syscall.c
This commit is contained in:
Masamichi Takagi
2018-01-26 22:00:24 +09:00
parent 51bc5fd61f
commit 65667709a8
4 changed files with 25 additions and 20 deletions

View File

@@ -2571,14 +2571,15 @@ out:
return error;
}
void hold_thread(struct thread *thread)
int hold_thread(struct thread *thread)
{
if (thread->status == PS_EXITED) {
panic("hold_thread: already exited process");
kprintf("hold_thread: ERROR: already exited process,tid=%d\n", thread->tid);
return -ESRCH;
}
ihk_atomic_inc(&thread->refcount);
return;
return 0;
}
void