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

Function slow_child_work

tests/system_test/wait_test.cpp:161–174  ·  view source on GitHub ↗

* @brief 测试非阻塞 wait (WNOHANG) */

Source from the content-addressed store, hash-verified

159 * @brief 测试非阻塞 wait (WNOHANG)
160 */
161void slow_child_work(void* arg) {
162 uint64_t child_id = reinterpret_cast<uint64_t>(arg);
163
164 klog::Info("SlowChild {}: starting", child_id);
165
166 // 执行较长时间的工作
167 for (int i = 0; i < 10; ++i) {
168 klog::Debug("SlowChild {}: working, iter={}", child_id, i);
169 (void)sys_sleep(100);
170 }
171
172 klog::Info("SlowChild {}: exiting", child_id);
173 sys_exit(0);
174}
175
176void test_wait_no_hang(void* /*arg*/) {
177 klog::Info("=== Wait NoHang Test ===");

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