Add missing lock statement

This commit is contained in:
Justine Tunney 2024-07-20 03:47:22 -07:00
parent 527aaa41eb
commit 626a5d02ee
No known key found for this signature in database
GPG key ID: BE714B4575D6E328

View file

@ -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);