From: Damjan Jovanovic Subject: [PATCH 4/7] winex11.drv: elimininate the unnecessary XDND critical section Message-Id: Date: Mon, 25 Apr 2016 03:00:41 +0200 Everything happens on the UI thread, so there's no point in doing any synchronization. Signed-off-by: Damjan Jovanovic --- dlls/winex11.drv/xdnd.c | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/dlls/winex11.drv/xdnd.c b/dlls/winex11.drv/xdnd.c index c852d44..c9fddbe 100644 --- a/dlls/winex11.drv/xdnd.c +++ b/dlls/winex11.drv/xdnd.c @@ -81,15 +81,6 @@ static BOOL X11DRV_XDND_HasHDROP(void); static HRESULT X11DRV_XDND_SendDropFiles(HWND hwnd); static void X11DRV_XDND_FreeDragDropOp(void); -static CRITICAL_SECTION xdnd_cs; -static CRITICAL_SECTION_DEBUG critsect_debug = -{ - 0, 0, &xdnd_cs, - { &critsect_debug.ProcessLocksList, &critsect_debug.ProcessLocksList }, - 0, 0, { (DWORD_PTR)(__FILE__ ": xdnd_cs") } -}; -static CRITICAL_SECTION xdnd_cs = { &critsect_debug, -1, 0, 0, 0, 0 }; - /* Based on functions in dlls/ole32/ole2.c */ static HANDLE get_droptarget_local_handle(HWND hwnd) @@ -597,12 +588,10 @@ static void X11DRV_XDND_InsertXDNDData(int property, int format, HANDLE contents if (current) { - EnterCriticalSection(&xdnd_cs); current->cf_xdnd = property; current->cf_win = format; current->contents = contents; list_add_tail(&xdndData, ¤t->entry); - LeaveCriticalSection(&xdnd_cs); } } @@ -615,8 +604,6 @@ static BOOL X11DRV_XDND_HasHDROP(void) LPXDNDDATA current = NULL; BOOL found = FALSE; - EnterCriticalSection(&xdnd_cs); - /* Find CF_HDROP type if any */ LIST_FOR_EACH_ENTRY(current, &xdndData, XDNDDATA, entry) { @@ -627,8 +614,6 @@ static BOOL X11DRV_XDND_HasHDROP(void) } } - LeaveCriticalSection(&xdnd_cs); - return found; } @@ -641,8 +626,6 @@ static HRESULT X11DRV_XDND_SendDropFiles(HWND hwnd) LPXDNDDATA current = NULL; BOOL found = FALSE; - EnterCriticalSection(&xdnd_cs); - LIST_FOR_EACH_ENTRY(current, &xdndData, XDNDDATA, entry) { if (current->cf_win == CF_HDROP) @@ -680,8 +663,6 @@ static HRESULT X11DRV_XDND_SendDropFiles(HWND hwnd) else hr = E_FAIL; - LeaveCriticalSection(&xdnd_cs); - return hr; } @@ -696,8 +677,6 @@ static void X11DRV_XDND_FreeDragDropOp(void) TRACE("\n"); - EnterCriticalSection(&xdnd_cs); - /** Free data cache */ LIST_FOR_EACH_ENTRY_SAFE(current, next, &xdndData, XDNDDATA, entry) { @@ -714,8 +693,6 @@ static void X11DRV_XDND_FreeDragDropOp(void) XDNDLastTargetWnd = NULL; XDNDLastDropTargetWnd = NULL; XDNDAccepted = FALSE; - - LeaveCriticalSection(&xdnd_cs); }