From 626a5d02ee4c08ef460a81c83d46ee6c18ad08e9 Mon Sep 17 00:00:00 2001 From: Justine Tunney Date: Sat, 20 Jul 2024 03:47:22 -0700 Subject: [PATCH] Add missing lock statement --- libc/intrin/mmap.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libc/intrin/mmap.c b/libc/intrin/mmap.c index 4f6e90556..267f16742 100644 --- a/libc/intrin/mmap.c +++ b/libc/intrin/mmap.c @@ -312,7 +312,9 @@ struct Map *__maps_alloc(void) { map->prot = PROT_READ | PROT_WRITE; map->flags = MAP_PRIVATE | MAP_ANONYMOUS | MAP_NOFORK; map->hand = sys.maphandle; + __maps_lock(); __maps_insert(map++); + __maps_unlock(); map->addr = MAP_FAILED; for (int i = 1; i < gransz / sizeof(struct Map) - 1; ++i) __maps_free(map + i);