From: Tim Clem tclem@codeweavers.com
--- dlls/ntdll/unix/thread.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/dlls/ntdll/unix/thread.c b/dlls/ntdll/unix/thread.c index 9b0b5f7ce22..2c1bf3ca637 100644 --- a/dlls/ntdll/unix/thread.c +++ b/dlls/ntdll/unix/thread.c @@ -1442,7 +1442,9 @@ static DECLSPEC_NORETURN void exit_thread( int status ) virtual_free_teb( teb ); } } - signal_exit_thread( status, pthread_exit_wrapper, NtCurrentTeb() ); + + if (InterlockedDecrement( &nb_threads ) <= 0) exit_process( status ); + else signal_exit_thread( status, pthread_exit_wrapper, NtCurrentTeb() ); }