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

Function child_work

tests/system_test/wait_test.cpp:32–46  ·  view source on GitHub ↗

* @brief 子进程工作函数 */

Source from the content-addressed store, hash-verified

30 * @brief 子进程工作函数
31 */
32void child_work(void* arg) {
33 uint64_t child_id = reinterpret_cast<uint64_t>(arg);
34 int exit_code = static_cast<int>(child_id);
35
36 klog::Info("Child {}: starting, will exit with code {}", child_id, exit_code);
37
38 // 执行一些工作
39 for (int i = 0; i < 5; ++i) {
40 klog::Debug("Child {}: working, iter={}", child_id, i);
41 (void)sys_sleep(30);
42 }
43
44 klog::Info("Child {}: exiting with code {}", child_id, exit_code);
45 sys_exit(exit_code);
46}
47
48/**
49 * @brief 测试基本的 wait 功能

Callers

nothing calls this directly

Calls 4

InfoFunction · 0.85
DebugFunction · 0.85
sys_sleepFunction · 0.85
sys_exitFunction · 0.85

Tested by

no test coverage detected