#include "pipe/p_compiler.h"
+#include "util/simple_mtx.h"
#include "util/u_debug.h"
#include "util/u_thread.h"
#include "util/u_memory.h"
#define EXEC_HEAP_SIZE (10*1024*1024)
-static mtx_t exec_mutex = _MTX_INITIALIZER_NP;
+static simple_mtx_t exec_mutex = SIMPLE_MTX_INITIALIZER;
static struct mem_block *exec_heap = NULL;
static unsigned char *exec_mem = NULL;
struct mem_block *block = NULL;
void *addr = NULL;
- mtx_lock(&exec_mutex);
+ simple_mtx_lock(&exec_mutex);
if (!init_heap())
goto bail;
debug_printf("rtasm_exec_malloc failed\n");
bail:
- mtx_unlock(&exec_mutex);
+ simple_mtx_unlock(&exec_mutex);
return addr;
}
void
rtasm_exec_free(void *addr)
{
- mtx_lock(&exec_mutex);
+ simple_mtx_lock(&exec_mutex);
if (exec_heap) {
struct mem_block *block = u_mmFindBlock(exec_heap, (unsigned char *)addr - exec_mem);
u_mmFreeMem(block);
}
- mtx_unlock(&exec_mutex);
+ simple_mtx_unlock(&exec_mutex);
}