Commit 146fb0de authored by Alexandre Julliard's avatar Alexandre Julliard

ntdll: Make the virtual.c critical section uninterruptible by signals.

Based on a patch by Thomas Kho.
parent 3c55f78f
......@@ -20,6 +20,7 @@
#define __WINE_NTDLL_MISC_H
#include <stdarg.h>
#include <signal.h>
#include "windef.h"
#include "winnt.h"
......@@ -61,6 +62,8 @@ extern void DECLSPEC_NORETURN server_protocol_error( const char *err, ... );
extern void DECLSPEC_NORETURN server_protocol_perror( const char *err );
extern void DECLSPEC_NORETURN server_exit_thread( int status );
extern void DECLSPEC_NORETURN server_abort_thread( int status );
void server_enter_uninterrupted_section( RTL_CRITICAL_SECTION *cs, sigset_t *sigset );
void server_leave_uninterrupted_section( RTL_CRITICAL_SECTION *cs, sigset_t *sigset );
extern int server_remove_fd_from_cache( obj_handle_t handle );
extern int server_get_unix_fd( obj_handle_t handle, unsigned int access, int *unix_fd,
int *needs_close, enum server_fd_type *type, int *flags );
......
......@@ -327,6 +327,26 @@ unsigned int wine_server_call( void *req_ptr )
/***********************************************************************
* server_enter_uninterrupted_section
*/
void server_enter_uninterrupted_section( RTL_CRITICAL_SECTION *cs, sigset_t *sigset )
{
pthread_functions.sigprocmask( SIG_BLOCK, &block_set, sigset );
RtlEnterCriticalSection( cs );
}
/***********************************************************************
* server_leave_uninterrupted_section
*/
void server_leave_uninterrupted_section( RTL_CRITICAL_SECTION *cs, sigset_t *sigset )
{
RtlLeaveCriticalSection( cs );
pthread_functions.sigprocmask( SIG_SETMASK, sigset, NULL );
}
/***********************************************************************
* wine_server_send_fd (NTDLL.@)
*
* Send a file descriptor to the server.
......
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