summaryrefslogtreecommitdiff
blob: 25eb2357f9b369b248f3ba070b894cd0ecb25ed2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
From b97783fd33b4d9897c149d7a14747aa4969bd9e9 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Thu, 19 Mar 2015 07:56:04 +0100
Subject: Reapply various changes conflicting with Maarten Lankhorst's
 gstreamer hack v5.

---
 dlls/ntdll/thread.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/dlls/ntdll/thread.c b/dlls/ntdll/thread.c
index 1e7f231..cf0461d 100644
--- a/dlls/ntdll/thread.c
+++ b/dlls/ntdll/thread.c
@@ -461,6 +461,8 @@ static void exit_thread_common( int status )
     static void *prev_teb;
     TEB *teb;
 #endif
+    shmlocal_t *shmlocal;
+    sigset_t sigset;
 
     if (status)  /* send the exit code to the server (0 is already the default) */
     {
@@ -502,6 +504,11 @@ static void exit_thread_common( int status )
     reap_thread(NtCurrentTeb());
 #endif
 
+    sigemptyset( &sigset );
+    sigaddset( &sigset, SIGQUIT );
+    pthread_sigmask( SIG_BLOCK, &sigset, NULL );
+    if (interlocked_xchg_add( &nb_threads, -1 ) <= 1) _exit( status );
+
     close( ntdll_get_thread_data()->wait_fd[0] );
     close( ntdll_get_thread_data()->wait_fd[1] );
     close( ntdll_get_thread_data()->reply_fd );
-- 
2.3.2