summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/rtasm
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2008-08-26 16:35:12 -0600
committerBrian Paul <[email protected]>2008-08-26 16:35:12 -0600
commit0bb852fa49e7f9a31036089ea4f5dfbd312a4a3a (patch)
tree7f93ecd62f156d5c94b176cd7e4f083823051f67 /src/gallium/auxiliary/rtasm
parentb5ab3b7dfc42a568a156dec2fa043292014f98a7 (diff)
gallium: thread wrapper clean-up
In p_thread.h replace _glthread_* functions with new pipe_* functions. Remove other old cruft.
Diffstat (limited to 'src/gallium/auxiliary/rtasm')
-rw-r--r--src/gallium/auxiliary/rtasm/rtasm_execmem.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/gallium/auxiliary/rtasm/rtasm_execmem.c b/src/gallium/auxiliary/rtasm/rtasm_execmem.c
index dfa5c35ab6a..19087589a87 100644
--- a/src/gallium/auxiliary/rtasm/rtasm_execmem.c
+++ b/src/gallium/auxiliary/rtasm/rtasm_execmem.c
@@ -47,11 +47,12 @@
#include <unistd.h>
#include <sys/mman.h>
+#include "pipe/p_thread.h"
#include "util/u_mm.h"
#define EXEC_HEAP_SIZE (10*1024*1024)
-_glthread_DECLARE_STATIC_MUTEX(exec_mutex);
+pipe_static_mutex(exec_mutex);
static struct mem_block *exec_heap = NULL;
static unsigned char *exec_mem = NULL;
@@ -76,7 +77,7 @@ rtasm_exec_malloc(size_t size)
struct mem_block *block = NULL;
void *addr = NULL;
- _glthread_LOCK_MUTEX(exec_mutex);
+ pipe_mutex_lock(exec_mutex);
init_heap();
@@ -90,7 +91,7 @@ rtasm_exec_malloc(size_t size)
else
debug_printf("rtasm_exec_malloc failed\n");
- _glthread_UNLOCK_MUTEX(exec_mutex);
+ pipe_mutex_unlock(exec_mutex);
return addr;
}
@@ -99,7 +100,7 @@ rtasm_exec_malloc(size_t size)
void
rtasm_exec_free(void *addr)
{
- _glthread_LOCK_MUTEX(exec_mutex);
+ pipe_mutex_lock(exec_mutex);
if (exec_heap) {
struct mem_block *block = mmFindBlock(exec_heap, (unsigned char *)addr - exec_mem);
@@ -108,7 +109,7 @@ rtasm_exec_free(void *addr)
mmFreeMem(block);
}
- _glthread_UNLOCK_MUTEX(exec_mutex);
+ pipe_mutex_unlock(exec_mutex);
}