From e534029ca0e8dd17d63828067bde562c0aaa7094 Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Mon, 16 Dec 2024 14:20:11 -0500 Subject: [PATCH] libroot: Remove some old TODOs from fork() implementation. The first was added in 2004 when there wasn't even a branch for initializing the child; I think this can be considered done now. The second was added in 2010, but it seems in the meantime we've decided that reinitializing locks is the best way to make them consistent after calling fork(), so it's also obsolete. --- src/system/libroot/posix/unistd/fork.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/system/libroot/posix/unistd/fork.c b/src/system/libroot/posix/unistd/fork.c index a149fba6c9..feb32e23e7 100644 --- a/src/system/libroot/posix/unistd/fork.c +++ b/src/system/libroot/posix/unistd/fork.c @@ -154,14 +154,10 @@ fork(void) thread = _kern_fork(); if (thread == 0) { // we are the child - // ToDo: initialize child __main_thread_id = find_thread(NULL); pthread_self()->id = __main_thread_id; mutex_init(&sForkLock, FORK_LOCK_NAME); - // TODO: The lock is already initialized and we in the fork()ing - // process we should make sure that it is in a consistent state when - // calling the kernel. __gRuntimeLoader->reinit_after_fork(); __heap_after_fork_child(); __reinit_pwd_backend_after_fork();