Commit 36334a1b authored by Alexandre Julliard's avatar Alexandre Julliard

ntdll: Call pthread_sigmask directly instead of through the pthread function table.

parent 9e8016c3
...@@ -39,7 +39,6 @@ ...@@ -39,7 +39,6 @@
#include "wine/exception.h" #include "wine/exception.h"
#include "wine/library.h" #include "wine/library.h"
#include "wine/pthread.h"
#include "wine/unicode.h" #include "wine/unicode.h"
#include "wine/debug.h" #include "wine/debug.h"
#include "wine/server.h" #include "wine/server.h"
...@@ -56,8 +55,6 @@ WINE_DECLARE_DEBUG_CHANNEL(imports); ...@@ -56,8 +55,6 @@ WINE_DECLARE_DEBUG_CHANNEL(imports);
#define RT_MANIFEST ((ULONG_PTR)24) #define RT_MANIFEST ((ULONG_PTR)24)
#define ISOLATIONAWARE_MANIFEST_RESOURCE_ID ((ULONG_PTR)2) #define ISOLATIONAWARE_MANIFEST_RESOURCE_ID ((ULONG_PTR)2)
extern struct wine_pthread_functions pthread_functions;
typedef DWORD (CALLBACK *DLLENTRYPROC)(HMODULE,DWORD,LPVOID); typedef DWORD (CALLBACK *DLLENTRYPROC)(HMODULE,DWORD,LPVOID);
static int process_detaching = 0; /* set on process detach to avoid deadlocks with thread detach */ static int process_detaching = 0; /* set on process detach to avoid deadlocks with thread detach */
...@@ -2426,7 +2423,7 @@ static NTSTATUS attach_process_dlls( void *wm ) ...@@ -2426,7 +2423,7 @@ static NTSTATUS attach_process_dlls( void *wm )
{ {
NTSTATUS status; NTSTATUS status;
pthread_functions.sigprocmask( SIG_UNBLOCK, &server_block_set, NULL ); pthread_sigmask( SIG_UNBLOCK, &server_block_set, NULL );
RtlEnterCriticalSection( &loader_section ); RtlEnterCriticalSection( &loader_section );
if ((status = process_attach( wm, (LPVOID)1 )) != STATUS_SUCCESS) if ((status = process_attach( wm, (LPVOID)1 )) != STATUS_SUCCESS)
......
...@@ -163,7 +163,7 @@ void server_exit_thread( int status ) ...@@ -163,7 +163,7 @@ void server_exit_thread( int status )
fds[1] = ntdll_get_thread_data()->wait_fd[1]; fds[1] = ntdll_get_thread_data()->wait_fd[1];
fds[2] = ntdll_get_thread_data()->reply_fd; fds[2] = ntdll_get_thread_data()->reply_fd;
fds[3] = ntdll_get_thread_data()->request_fd; fds[3] = ntdll_get_thread_data()->request_fd;
pthread_functions.sigprocmask( SIG_BLOCK, &server_block_set, NULL ); pthread_sigmask( SIG_BLOCK, &server_block_set, NULL );
info.stack_size = virtual_free_system_view( &info.stack_base ); info.stack_size = virtual_free_system_view( &info.stack_base );
info.teb_size = virtual_free_system_view( &info.teb_base ); info.teb_size = virtual_free_system_view( &info.teb_base );
...@@ -181,7 +181,7 @@ void server_exit_thread( int status ) ...@@ -181,7 +181,7 @@ void server_exit_thread( int status )
*/ */
void server_abort_thread( int status ) void server_abort_thread( int status )
{ {
pthread_functions.sigprocmask( SIG_BLOCK, &server_block_set, NULL ); pthread_sigmask( SIG_BLOCK, &server_block_set, NULL );
close( ntdll_get_thread_data()->wait_fd[0] ); close( ntdll_get_thread_data()->wait_fd[0] );
close( ntdll_get_thread_data()->wait_fd[1] ); close( ntdll_get_thread_data()->wait_fd[1] );
close( ntdll_get_thread_data()->reply_fd ); close( ntdll_get_thread_data()->reply_fd );
...@@ -323,10 +323,10 @@ unsigned int wine_server_call( void *req_ptr ) ...@@ -323,10 +323,10 @@ unsigned int wine_server_call( void *req_ptr )
sigset_t old_set; sigset_t old_set;
unsigned int ret; unsigned int ret;
pthread_functions.sigprocmask( SIG_BLOCK, &server_block_set, &old_set ); pthread_sigmask( SIG_BLOCK, &server_block_set, &old_set );
ret = send_request( req ); ret = send_request( req );
if (!ret) ret = wait_reply( req ); if (!ret) ret = wait_reply( req );
pthread_functions.sigprocmask( SIG_SETMASK, &old_set, NULL ); pthread_sigmask( SIG_SETMASK, &old_set, NULL );
return ret; return ret;
} }
...@@ -336,7 +336,7 @@ unsigned int wine_server_call( void *req_ptr ) ...@@ -336,7 +336,7 @@ unsigned int wine_server_call( void *req_ptr )
*/ */
void server_enter_uninterrupted_section( RTL_CRITICAL_SECTION *cs, sigset_t *sigset ) void server_enter_uninterrupted_section( RTL_CRITICAL_SECTION *cs, sigset_t *sigset )
{ {
pthread_functions.sigprocmask( SIG_BLOCK, &server_block_set, sigset ); pthread_sigmask( SIG_BLOCK, &server_block_set, sigset );
RtlEnterCriticalSection( cs ); RtlEnterCriticalSection( cs );
} }
...@@ -347,7 +347,7 @@ void server_enter_uninterrupted_section( RTL_CRITICAL_SECTION *cs, sigset_t *sig ...@@ -347,7 +347,7 @@ void server_enter_uninterrupted_section( RTL_CRITICAL_SECTION *cs, sigset_t *sig
void server_leave_uninterrupted_section( RTL_CRITICAL_SECTION *cs, sigset_t *sigset ) void server_leave_uninterrupted_section( RTL_CRITICAL_SECTION *cs, sigset_t *sigset )
{ {
RtlLeaveCriticalSection( cs ); RtlLeaveCriticalSection( cs );
pthread_functions.sigprocmask( SIG_SETMASK, sigset, NULL ); pthread_sigmask( SIG_SETMASK, sigset, NULL );
} }
...@@ -985,7 +985,7 @@ void server_init_process(void) ...@@ -985,7 +985,7 @@ void server_init_process(void)
sigaddset( &server_block_set, SIGUSR1 ); sigaddset( &server_block_set, SIGUSR1 );
sigaddset( &server_block_set, SIGUSR2 ); sigaddset( &server_block_set, SIGUSR2 );
sigaddset( &server_block_set, SIGCHLD ); sigaddset( &server_block_set, SIGCHLD );
pthread_functions.sigprocmask( SIG_BLOCK, &server_block_set, NULL ); pthread_sigmask( SIG_BLOCK, &server_block_set, NULL );
/* receive the first thread request fd on the main socket */ /* receive the first thread request fd on the main socket */
ntdll_get_thread_data()->request_fd = receive_fd( &version ); ntdll_get_thread_data()->request_fd = receive_fd( &version );
......
...@@ -88,7 +88,7 @@ static void ldt_lock(void) ...@@ -88,7 +88,7 @@ static void ldt_lock(void)
{ {
sigset_t sigset; sigset_t sigset;
pthread_functions.sigprocmask( SIG_BLOCK, &server_block_set, &sigset ); pthread_sigmask( SIG_BLOCK, &server_block_set, &sigset );
RtlEnterCriticalSection( &ldt_section ); RtlEnterCriticalSection( &ldt_section );
if (ldt_section.RecursionCount == 1) ldt_sigset = sigset; if (ldt_section.RecursionCount == 1) ldt_sigset = sigset;
} }
...@@ -99,7 +99,7 @@ static void ldt_unlock(void) ...@@ -99,7 +99,7 @@ static void ldt_unlock(void)
{ {
sigset_t sigset = ldt_sigset; sigset_t sigset = ldt_sigset;
RtlLeaveCriticalSection( &ldt_section ); RtlLeaveCriticalSection( &ldt_section );
pthread_functions.sigprocmask( SIG_SETMASK, &sigset, NULL ); pthread_sigmask( SIG_SETMASK, &sigset, NULL );
} }
else RtlLeaveCriticalSection( &ldt_section ); else RtlLeaveCriticalSection( &ldt_section );
} }
...@@ -428,7 +428,7 @@ static void start_thread( struct wine_pthread_thread_info *info ) ...@@ -428,7 +428,7 @@ static void start_thread( struct wine_pthread_thread_info *info )
server_init_thread( func ); server_init_thread( func );
pthread_functions.init_thread( info ); pthread_functions.init_thread( info );
virtual_alloc_thread_stack( info->stack_base, info->stack_size ); virtual_alloc_thread_stack( info->stack_base, info->stack_size );
pthread_functions.sigprocmask( SIG_UNBLOCK, &server_block_set, NULL ); pthread_sigmask( SIG_UNBLOCK, &server_block_set, NULL );
RtlAcquirePebLock(); RtlAcquirePebLock();
InsertHeadList( &tls_links, &teb->TlsLinks ); InsertHeadList( &tls_links, &teb->TlsLinks );
...@@ -524,7 +524,7 @@ NTSTATUS WINAPI RtlCreateUserThread( HANDLE process, const SECURITY_DESCRIPTOR * ...@@ -524,7 +524,7 @@ NTSTATUS WINAPI RtlCreateUserThread( HANDLE process, const SECURITY_DESCRIPTOR *
return status; return status;
} }
pthread_functions.sigprocmask( SIG_BLOCK, &server_block_set, &sigset ); pthread_sigmask( SIG_BLOCK, &server_block_set, &sigset );
addr = NULL; addr = NULL;
size = sigstack_total_size; size = sigstack_total_size;
...@@ -577,7 +577,7 @@ NTSTATUS WINAPI RtlCreateUserThread( HANDLE process, const SECURITY_DESCRIPTOR * ...@@ -577,7 +577,7 @@ NTSTATUS WINAPI RtlCreateUserThread( HANDLE process, const SECURITY_DESCRIPTOR *
status = STATUS_NO_MEMORY; status = STATUS_NO_MEMORY;
goto error; goto error;
} }
pthread_functions.sigprocmask( SIG_SETMASK, &sigset, NULL ); pthread_sigmask( SIG_SETMASK, &sigset, NULL );
if (id) id->UniqueThread = ULongToHandle(tid); if (id) id->UniqueThread = ULongToHandle(tid);
if (handle_ptr) *handle_ptr = handle; if (handle_ptr) *handle_ptr = handle;
...@@ -593,7 +593,7 @@ error: ...@@ -593,7 +593,7 @@ error:
NtFreeVirtualMemory( NtCurrentProcess(), &addr, &size, MEM_RELEASE ); NtFreeVirtualMemory( NtCurrentProcess(), &addr, &size, MEM_RELEASE );
} }
if (handle) NtClose( handle ); if (handle) NtClose( handle );
pthread_functions.sigprocmask( SIG_SETMASK, &sigset, NULL ); pthread_sigmask( SIG_SETMASK, &sigset, NULL );
close( request_pipe[1] ); close( request_pipe[1] );
return status; return status;
} }
......
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