summaryrefslogtreecommitdiff
path: root/display
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2010-08-23 12:45:07 +0200
committerAlexander Larsson <alexl@redhat.com>2010-08-23 12:45:07 +0200
commite10b5a283779d4d180ff398c172b392d9ced70cc (patch)
tree0d012f33f0f251d8c32f4d1d84051129598d5f94 /display
parent8b5f476e2087f4708a3bc744583bf42eb8ea9ab8 (diff)
Grab malloc_sem in FreeMem
This is needed as much as in AllocMem to protect the mspaces data from concurrent access.
Diffstat (limited to 'display')
-rw-r--r--display/res.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/display/res.c b/display/res.c
index 1f67dbf..6fe375f 100644
--- a/display/res.c
+++ b/display/res.c
@@ -337,7 +337,9 @@ static void FreeMem(PDev* pdev, UINT32 mspace_type, void *ptr)
ASSERT(pdev, pdev && pdev->Res.mspaces[mspace_type]._mspace);
ASSERT(pdev, (UINT8 *)ptr >= pdev->Res.mspaces[mspace_type].mspace_start &&
(UINT8 *)ptr < pdev->Res.mspaces[mspace_type].mspace_end);
+ EngAcquireSemaphore(pdev->Res.malloc_sem);
mspace_free(pdev->Res.mspaces[mspace_type]._mspace, ptr);
+ EngReleaseSemaphore(pdev->Res.malloc_sem);
}
DevRes *global_res = NULL;