Commit 53978351 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

winex11: Use pthread for D3DKMT locking.

parent fd83308b
......@@ -95,14 +95,7 @@ static int (*old_error_handler)( Display *, XErrorEvent * );
static BOOL use_xim = TRUE;
static WCHAR input_style[20];
static CRITICAL_SECTION x11drv_section;
static CRITICAL_SECTION_DEBUG critsect_debug =
{
0, 0, &x11drv_section,
{ &critsect_debug.ProcessLocksList, &critsect_debug.ProcessLocksList },
0, 0, { (DWORD_PTR)(__FILE__ ": x11drv_section") }
};
static CRITICAL_SECTION x11drv_section = { &critsect_debug, -1, 0, 0, 0, 0 };
static pthread_mutex_t d3dkmt_mutex = PTHREAD_MUTEX_INITIALIZER;
static CRITICAL_SECTION x11drv_error_section;
static CRITICAL_SECTION_DEBUG x11drv_error_section_debug =
......@@ -863,7 +856,7 @@ NTSTATUS CDECL X11DRV_D3DKMTSetVidPnSourceOwner( const D3DKMT_SETVIDPNSOURCEOWNE
TRACE("(%p)\n", desc);
EnterCriticalSection( &x11drv_section );
pthread_mutex_lock( &d3dkmt_mutex );
/* Check parameters */
for (i = 0; i < desc->VidPnSourceCount; ++i)
......@@ -962,7 +955,7 @@ NTSTATUS CDECL X11DRV_D3DKMTSetVidPnSourceOwner( const D3DKMT_SETVIDPNSOURCEOWNE
}
done:
LeaveCriticalSection( &x11drv_section );
pthread_mutex_unlock( &d3dkmt_mutex );
return status;
}
......@@ -978,15 +971,15 @@ NTSTATUS CDECL X11DRV_D3DKMTCheckVidPnExclusiveOwnership( const D3DKMT_CHECKVIDP
if (!desc || !desc->hAdapter)
return STATUS_INVALID_PARAMETER;
EnterCriticalSection( &x11drv_section );
pthread_mutex_lock( &d3dkmt_mutex );
LIST_FOR_EACH_ENTRY( source, &d3dkmt_vidpn_sources, struct d3dkmt_vidpn_source, entry )
{
if (source->id == desc->VidPnSourceId && source->type == D3DKMT_VIDPNSOURCEOWNER_EXCLUSIVE)
{
LeaveCriticalSection( &x11drv_section );
pthread_mutex_unlock( &d3dkmt_mutex );
return STATUS_GRAPHICS_PRESENT_OCCLUDED;
}
}
LeaveCriticalSection( &x11drv_section );
pthread_mutex_unlock( &d3dkmt_mutex );
return STATUS_SUCCESS;
}
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