wined3d: Remove resourceStoreCriticalSection.

Jan Zerebecki jan.wine at zerebecki.de
Mon Apr 16 02:54:36 CDT 2007


---

I agreed with Stefan Dösinger about this course of action.
---
If this patch is rejected from inclusion, please tell me why, as
I would have to ask anyway.

 dlls/wined3d/device.c       |   15 ---------------
 dlls/wined3d/wined3d_main.c |    7 -------
 2 files changed, 0 insertions(+), 22 deletions(-)

diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 2f6b03b..48f1615 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -5866,9 +5866,6 @@ static void WINAPI IWineD3DDeviceImpl_AddResource(IWineD3DDevice *iface, IWineD3
     ResourceList* resourceList;
 
     TRACE("(%p) : resource %p\n", This, resource);
-#if 0
-    EnterCriticalSection(&resourceStoreCriticalSection);
-#endif
     /* add a new texture to the frot of the linked list */
     resourceList = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(ResourceList));
     resourceList->resource = resource;
@@ -5879,9 +5876,6 @@ static void WINAPI IWineD3DDeviceImpl_AddResource(IWineD3DDevice *iface, IWineD3
     This->resources = resourceList;
     TRACE("Added resource %p with element %p pointing to %p\n", resource, resourceList, resourceList->next);
 
-#if 0
-    LeaveCriticalSection(&resourceStoreCriticalSection);
-#endif
     return;
 }
 
@@ -5892,9 +5886,6 @@ static void WINAPI IWineD3DDeviceImpl_RemoveResource(IWineD3DDevice *iface, IWin
     
     TRACE("(%p) : resource %p\n", This, resource);
 
-#if 0
-    EnterCriticalSection(&resourceStoreCriticalSection);
-#endif
     resourceList = This->resources;
 
     while (resourceList != NULL) {
@@ -5905,9 +5896,6 @@ static void WINAPI IWineD3DDeviceImpl_RemoveResource(IWineD3DDevice *iface, IWin
 
     if (resourceList == NULL) {
         FIXME("Attempted to remove resource %p that hasn't been stored\n", resource);
-#if 0
-        LeaveCriticalSection(&resourceStoreCriticalSection);
-#endif
         return;
     } else {
             TRACE("Found resource  %p with element %p pointing to %p (previous %p)\n", resourceList->resource, resourceList, resourceList->next, previousResourceList);
@@ -5919,9 +5907,6 @@ static void WINAPI IWineD3DDeviceImpl_RemoveResource(IWineD3DDevice *iface, IWin
         This->resources = resourceList->next;
     }
 
-#if 0
-    LeaveCriticalSection(&resourceStoreCriticalSection);
-#endif
     return;
 }
 
diff --git a/dlls/wined3d/wined3d_main.c b/dlls/wined3d/wined3d_main.c
index 965d95d..5d00ba8 100644
--- a/dlls/wined3d/wined3d_main.c
+++ b/dlls/wined3d/wined3d_main.c
@@ -46,17 +46,14 @@ wined3d_settings_t wined3d_settings =
 };
 
 WineD3DGlobalStatistics *wineD3DGlobalStatistics = NULL;
-CRITICAL_SECTION resourceStoreCriticalSection;
 
 long globalChangeGlRam(long glram){
     /* FIXME: replace this function with object tracking */
     int result;
 
-    EnterCriticalSection(&resourceStoreCriticalSection); /* this is overkill really, but I suppose it should be thread safe */
     wineD3DGlobalStatistics->glsurfaceram     += glram;
     TRACE("Adjusted gl ram by %ld to %d\n", glram, wineD3DGlobalStatistics->glsurfaceram);
     result = wineD3DGlobalStatistics->glsurfaceram;
-    LeaveCriticalSection(&resourceStoreCriticalSection);
     return result;
 
 }
@@ -68,10 +65,6 @@ IWineD3D* WINAPI WineDirect3DCreate(UINT SDKVersion, UINT dxVersion, IUnknown *p
     object->ref = 1;
     object->parent = parent;
 
-    /* TODO: Move this off to device and possibly x11drv */
-    /* Create a critical section for a dll global data store */
-    InitializeCriticalSectionAndSpinCount(&resourceStoreCriticalSection, 0x80000400);
-
     /*Create a structure for storing global data in*/
     if(wineD3DGlobalStatistics == NULL){
         TRACE("Creating global statistics store\n");



More information about the wine-patches mailing list