libroot: Acquire the process heap lock.

Upon further investigation, the global heap lock should actually
not need to be reset, but the process heap lock will.

Change-Id: Id1fd91cc0e7acecd5b4fd76cb82d4ed2ae3900ad
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6777
Reviewed-by: Jérôme Duval <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
This commit is contained in:
Augustin Cavalier
2023-08-07 16:12:01 +00:00
committed by waddlesplash
parent 2eddc82d0f
commit bfebd2b3c9
2 changed files with 6 additions and 2 deletions
@@ -79,8 +79,6 @@ __init_after_fork(void)
sHeapBase);
exit(1);
}
hoardLockInit(sHeapLock, "heap");
}
@@ -262,6 +262,8 @@ __heap_before_fork(void)
static processHeap *pHeap = getAllocator();
for (int i = 0; i < pHeap->getMaxThreadHeaps(); i++)
pHeap->getHeap(i).lock();
static_cast<hoardHeap*>(pHeap)->lock();
}
void __init_after_fork(void);
@@ -273,6 +275,8 @@ __heap_after_fork_child(void)
static processHeap *pHeap = getAllocator();
for (int i = 0; i < pHeap->getMaxThreadHeaps(); i++)
pHeap->getHeap(i).initLock();
pHeap->initLock();
}
@@ -282,6 +286,8 @@ __heap_after_fork_parent(void)
static processHeap *pHeap = getAllocator();
for (int i = 0; i < pHeap->getMaxThreadHeaps(); i++)
pHeap->getHeap(i).unlock();
static_cast<hoardHeap*>(pHeap)->unlock();
}