ntdll: Avoid possible deadlock by using _exit() in NtTerminateProcess.

When threads are killed with SIGQUIT some locks can be in an undefined
state, and it not safe to call exit handlers.
This commit is contained in:
Sebastian Lackner 2015-07-17 06:46:47 +02:00 committed by Alexandre Julliard
parent 453458f294
commit 4a1629c411
1 changed files with 6 additions and 1 deletions

View File

@ -21,11 +21,16 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#include "ntstatus.h"
#define WIN32_NO_STATUS
@ -60,7 +65,7 @@ NTSTATUS WINAPI NtTerminateProcess( HANDLE handle, LONG exit_code )
self = !ret && reply->self;
}
SERVER_END_REQ;
if (self && handle) exit( exit_code );
if (self && handle) _exit( exit_code );
return ret;
}