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

Function child_thread_work

tests/system_test/clone_test.cpp:64–79  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

62}
63
64void child_thread_work(void* arg) {
65 auto* current = TaskManagerSingleton::instance().GetCurrentTask();
66 uint64_t thread_id = reinterpret_cast<uint64_t>(arg);
67 if (thread_id == 1) {
68 g_thread1_pid.store(current->pid);
69 g_thread1_tgid.store(current->aux->tgid);
70 } else {
71 g_thread2_pid.store(current->pid);
72 g_thread2_tgid.store(current->aux->tgid);
73 }
74 g_thread_done++;
75 while (!g_threads_may_exit.load()) {
76 (void)sys_sleep(10);
77 }
78 sys_exit(0);
79}
80
81void leader_work(void* /*arg*/) {
82 auto* current = TaskManagerSingleton::instance().GetCurrentTask();

Callers

nothing calls this directly

Calls 3

sys_sleepFunction · 0.85
sys_exitFunction · 0.85
GetCurrentTaskMethod · 0.80

Tested by

no test coverage detected