Commit 2d91c7d3 authored by Jonas Termansen's avatar Jonas Termansen

Fix exit_thread(2) multi-threaded process destruction.

parent b3f31b1a
......@@ -342,7 +342,8 @@ int sys_exit_thread(int requested_exit_code,
if ( !(flags & EXIT_THREAD_ONLY_IF_OTHERS) || is_others )
thread->pledged_destruction = true;
bool are_threads_exiting = false;
if ( (flags & EXIT_THREAD_PROCESS) || !is_others )
bool do_exit = (flags & EXIT_THREAD_PROCESS) || !is_others;
if ( do_exit )
process->threads_exiting = true;
else if ( process->threads_exiting )
are_threads_exiting = true;
......@@ -381,7 +382,7 @@ int sys_exit_thread(int requested_exit_code,
if ( flags & EXIT_THREAD_ZERO )
ZeroUser(extended.zero_from, extended.zero_size);
if ( !is_others )
if ( do_exit )
{
// Validate the requested exit code such that the process can't exit
// with an impossible exit status or that it wasn't actually terminated.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment