X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fmapi%2Fu_execmem.c;h=89d5c1d08d5338b7262aa3a80bffb4d243839d59;hb=f4c61d422d5134bbcb0611692eb15bbe311916d2;hp=3573652635ff4896ab9ea5442066dcbd7b800ba7;hpb=3998cfa933dcd9134b75d9f0ae2c9cfcd6f2ee45;p=mesa.git diff --git a/src/mapi/u_execmem.c b/src/mapi/u_execmem.c index 3573652635f..89d5c1d08d5 100644 --- a/src/mapi/u_execmem.c +++ b/src/mapi/u_execmem.c @@ -32,14 +32,14 @@ */ -#include "u_compiler.h" -#include "u_thread.h" +#include "c99_compat.h" +#include "c11/threads.h" #include "u_execmem.h" #define EXEC_MAP_SIZE (4*1024) -u_mutex_declare_static(exec_mutex); +static mtx_t exec_mutex = _MTX_INITIALIZER_NP; static unsigned int head = 0; @@ -123,7 +123,7 @@ u_execmem_alloc(unsigned int size) { void *addr = NULL; - u_mutex_lock(exec_mutex); + mtx_lock(&exec_mutex); if (!init_map()) goto bail; @@ -137,7 +137,7 @@ u_execmem_alloc(unsigned int size) head += size; bail: - u_mutex_unlock(exec_mutex); + mtx_unlock(&exec_mutex); return addr; }