summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/execmem.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2014-03-01 10:21:07 -0700
committerBrian Paul <[email protected]>2014-03-03 13:08:58 -0700
commitd129ea7fa2e57288f64cd247a0ac6d876e1717d2 (patch)
tree599098d707f4b1c506b0e8ac4f614ea2a5d2de4f /src/mesa/main/execmem.c
parent2706db701d6217d245325f90f014233ff40ba18c (diff)
mesa: switch to c11 mutex functions
Reviewed-by: José Fonseca <[email protected]>
Diffstat (limited to 'src/mesa/main/execmem.c')
-rw-r--r--src/mesa/main/execmem.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/mesa/main/execmem.c b/src/mesa/main/execmem.c
index d63bb4a4e56..54239cc0a30 100644
--- a/src/mesa/main/execmem.c
+++ b/src/mesa/main/execmem.c
@@ -59,7 +59,7 @@
#define EXEC_HEAP_SIZE (10*1024*1024)
-_glthread_DECLARE_STATIC_MUTEX(exec_mutex);
+static mtx_t exec_mutex = _MTX_INITIALIZER_NP;
static struct mem_block *exec_heap = NULL;
static unsigned char *exec_mem = NULL;
@@ -93,7 +93,7 @@ _mesa_exec_malloc(GLuint size)
struct mem_block *block = NULL;
void *addr = NULL;
- _glthread_LOCK_MUTEX(exec_mutex);
+ mtx_lock(&exec_mutex);
if (!init_heap())
goto bail;
@@ -109,7 +109,7 @@ _mesa_exec_malloc(GLuint size)
printf("_mesa_exec_malloc failed\n");
bail:
- _glthread_UNLOCK_MUTEX(exec_mutex);
+ mtx_unlock(&exec_mutex);
return addr;
}
@@ -118,7 +118,7 @@ bail:
void
_mesa_exec_free(void *addr)
{
- _glthread_LOCK_MUTEX(exec_mutex);
+ mtx_lock(&exec_mutex);
if (exec_heap) {
struct mem_block *block = mmFindBlock(exec_heap, (unsigned char *)addr - exec_mem);
@@ -127,7 +127,7 @@ _mesa_exec_free(void *addr)
mmFreeMem(block);
}
- _glthread_UNLOCK_MUTEX(exec_mutex);
+ mtx_unlock(&exec_mutex);
}