Module: wine Branch: master Commit: 36334a1b5a19bd771da0eff6bc2271761003963a URL: http://source.winehq.org/git/wine.git/?a=commit;h=36334a1b5a19bd771da0eff6bc...
Author: Alexandre Julliard julliard@winehq.org Date: Fri Feb 20 11:15:06 2009 +0100
ntdll: Call pthread_sigmask directly instead of through the pthread function table.
---
dlls/ntdll/loader.c | 5 +---- dlls/ntdll/server.c | 14 +++++++------- dlls/ntdll/thread.c | 12 ++++++------ 3 files changed, 14 insertions(+), 17 deletions(-)
diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c index 560a932..c7fd267 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c @@ -39,7 +39,6 @@
#include "wine/exception.h" #include "wine/library.h" -#include "wine/pthread.h" #include "wine/unicode.h" #include "wine/debug.h" #include "wine/server.h" @@ -56,8 +55,6 @@ WINE_DECLARE_DEBUG_CHANNEL(imports); #define RT_MANIFEST ((ULONG_PTR)24) #define ISOLATIONAWARE_MANIFEST_RESOURCE_ID ((ULONG_PTR)2)
-extern struct wine_pthread_functions pthread_functions; - typedef DWORD (CALLBACK *DLLENTRYPROC)(HMODULE,DWORD,LPVOID);
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 ) { NTSTATUS status;
- pthread_functions.sigprocmask( SIG_UNBLOCK, &server_block_set, NULL ); + pthread_sigmask( SIG_UNBLOCK, &server_block_set, NULL );
RtlEnterCriticalSection( &loader_section ); if ((status = process_attach( wm, (LPVOID)1 )) != STATUS_SUCCESS) diff --git a/dlls/ntdll/server.c b/dlls/ntdll/server.c index 2a0b3e0..a56557a 100644 --- a/dlls/ntdll/server.c +++ b/dlls/ntdll/server.c @@ -163,7 +163,7 @@ void server_exit_thread( int status ) fds[1] = ntdll_get_thread_data()->wait_fd[1]; fds[2] = ntdll_get_thread_data()->reply_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.teb_size = virtual_free_system_view( &info.teb_base ); @@ -181,7 +181,7 @@ void server_exit_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[1] ); close( ntdll_get_thread_data()->reply_fd ); @@ -323,10 +323,10 @@ unsigned int wine_server_call( void *req_ptr ) sigset_t old_set; 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 ); if (!ret) ret = wait_reply( req ); - pthread_functions.sigprocmask( SIG_SETMASK, &old_set, NULL ); + pthread_sigmask( SIG_SETMASK, &old_set, NULL ); return ret; }
@@ -336,7 +336,7 @@ unsigned int wine_server_call( void *req_ptr ) */ 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 ); }
@@ -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 ) { RtlLeaveCriticalSection( cs ); - pthread_functions.sigprocmask( SIG_SETMASK, sigset, NULL ); + pthread_sigmask( SIG_SETMASK, sigset, NULL ); }
@@ -985,7 +985,7 @@ void server_init_process(void) sigaddset( &server_block_set, SIGUSR1 ); sigaddset( &server_block_set, SIGUSR2 ); 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 */ ntdll_get_thread_data()->request_fd = receive_fd( &version ); diff --git a/dlls/ntdll/thread.c b/dlls/ntdll/thread.c index 7c66660..255c523 100644 --- a/dlls/ntdll/thread.c +++ b/dlls/ntdll/thread.c @@ -88,7 +88,7 @@ static void ldt_lock(void) { sigset_t sigset;
- pthread_functions.sigprocmask( SIG_BLOCK, &server_block_set, &sigset ); + pthread_sigmask( SIG_BLOCK, &server_block_set, &sigset ); RtlEnterCriticalSection( &ldt_section ); if (ldt_section.RecursionCount == 1) ldt_sigset = sigset; } @@ -99,7 +99,7 @@ static void ldt_unlock(void) { sigset_t sigset = ldt_sigset; RtlLeaveCriticalSection( &ldt_section ); - pthread_functions.sigprocmask( SIG_SETMASK, &sigset, NULL ); + pthread_sigmask( SIG_SETMASK, &sigset, NULL ); } else RtlLeaveCriticalSection( &ldt_section ); } @@ -428,7 +428,7 @@ static void start_thread( struct wine_pthread_thread_info *info ) server_init_thread( func ); pthread_functions.init_thread( info ); 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(); InsertHeadList( &tls_links, &teb->TlsLinks ); @@ -524,7 +524,7 @@ NTSTATUS WINAPI RtlCreateUserThread( HANDLE process, const SECURITY_DESCRIPTOR * return status; }
- pthread_functions.sigprocmask( SIG_BLOCK, &server_block_set, &sigset ); + pthread_sigmask( SIG_BLOCK, &server_block_set, &sigset );
addr = NULL; size = sigstack_total_size; @@ -577,7 +577,7 @@ NTSTATUS WINAPI RtlCreateUserThread( HANDLE process, const SECURITY_DESCRIPTOR * status = STATUS_NO_MEMORY; goto error; } - pthread_functions.sigprocmask( SIG_SETMASK, &sigset, NULL ); + pthread_sigmask( SIG_SETMASK, &sigset, NULL );
if (id) id->UniqueThread = ULongToHandle(tid); if (handle_ptr) *handle_ptr = handle; @@ -593,7 +593,7 @@ error: NtFreeVirtualMemory( NtCurrentProcess(), &addr, &size, MEM_RELEASE ); } if (handle) NtClose( handle ); - pthread_functions.sigprocmask( SIG_SETMASK, &sigset, NULL ); + pthread_sigmask( SIG_SETMASK, &sigset, NULL ); close( request_pipe[1] ); return status; }