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 <jerome.duval@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
This commit is contained in:
Augustin Cavalier 2023-08-05 13:55:11 -04:00 committed by waddlesplash
parent 2eddc82d0f
commit bfebd2b3c9
2 changed files with 6 additions and 2 deletions

View File

@ -79,8 +79,6 @@ __init_after_fork(void)
sHeapBase);
exit(1);
}
hoardLockInit(sHeapLock, "heap");
}

View File

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