MCPcopy Create free account
hub / github.com/Simple-XX/SimpleKernel / child_process_work

Function child_process_work

tests/system_test/clone_test.cpp:48–62  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

46std::atomic<int> g_flags_done{0};
47
48void child_process_work(void* arg) {
49 auto* current = TaskManagerSingleton::instance().GetCurrentTask();
50 uint64_t child_id = reinterpret_cast<uint64_t>(arg);
51 if (child_id == 1) {
52 g_child1_pid.store(current->pid);
53 g_child1_tgid.store(current->aux->tgid);
54 g_child1_parent_pid.store(current->aux->parent_pid);
55 } else {
56 g_child2_pid.store(current->pid);
57 g_child2_tgid.store(current->aux->tgid);
58 g_child2_parent_pid.store(current->aux->parent_pid);
59 }
60 g_process_done++;
61 sys_exit(0);
62}
63
64void child_thread_work(void* arg) {
65 auto* current = TaskManagerSingleton::instance().GetCurrentTask();

Callers

nothing calls this directly

Calls 2

sys_exitFunction · 0.85
GetCurrentTaskMethod · 0.80

Tested by

no test coverage detected