summaryrefslogtreecommitdiff
blob: eee42ff900f83a3ef9c0302607c761316e1748df (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
39
40
41
42
43
44
45
46
47
48
From 0d92921d264d5d0d1041c66353f022f1bc88577f Mon Sep 17 00:00:00 2001
From: Alexandre Rostovtsev <tetromino@gentoo.org>
Date: Sun, 8 Mar 2015 00:10:31 -0500
Subject: [PATCH] Revert "ntdll: Fix race-condition when threads are killed
 during shutdown."

This reverts Sebastian Lackner's Wine-Staging patch to allow Maarten
Lankhorst's "override pthreads to fix gstreamer v5" to apply
---
 dlls/ntdll/thread.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/dlls/ntdll/thread.c b/dlls/ntdll/thread.c
index 74e64c9..3696c8e 100644
--- a/dlls/ntdll/thread.c
+++ b/dlls/ntdll/thread.c
@@ -370,7 +370,6 @@ void terminate_thread( int status )
 void exit_thread( int status )
 {
     static void *prev_teb;
-    sigset_t sigset;
     TEB *teb;
 
     if (status)  /* send the exit code to the server (0 is already the default) */
@@ -384,7 +383,7 @@ void exit_thread( int status )
         SERVER_END_REQ;
     }
 
-    if (interlocked_xchg_add( &nb_threads, 0 ) <= 1)
+    if (interlocked_xchg_add( &nb_threads, -1 ) <= 1)
     {
         LdrShutdownProcess();
         exit( status );
@@ -406,11 +405,6 @@ void exit_thread( int status )
         }
     }
 
-    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.1