X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fmapi%2Fu_execmem.c;h=89d5c1d08d5338b7262aa3a80bffb4d243839d59;hb=b78e2a197a1dd866024b0dc97689a006c0e6798f;hp=f2680287b633121048de9fd41565029b4d3516bd;hpb=3d8d5b298a268b119d840bc9bae0ee9e0c9244a9;p=mesa.git diff --git a/src/mapi/u_execmem.c b/src/mapi/u_execmem.c index f2680287b63..89d5c1d08d5 100644 --- a/src/mapi/u_execmem.c +++ b/src/mapi/u_execmem.c @@ -1,6 +1,5 @@ /* * Mesa 3-D graphics library - * Version: 6.5 * * Copyright (C) 1999-2005 Brian Paul All Rights Reserved. * @@ -33,21 +32,21 @@ */ -#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; static unsigned char *exec_mem = (unsigned char *)0; -#if defined(__linux__) || defined(__OpenBSD__) || defined(_NetBSD__) || defined(__sun) +#if defined(__linux__) || defined(__OpenBSD__) || defined(_NetBSD__) || defined(__sun) || defined(__HAIKU__) #include #include @@ -124,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; @@ -138,7 +137,7 @@ u_execmem_alloc(unsigned int size) head += size; bail: - u_mutex_unlock(exec_mutex); + mtx_unlock(&exec_mutex); return addr; }