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

Function thread_increment

tests/system_test/thread_group_test.cpp:34–47  ·  view source on GitHub ↗

* @brief 线程函数,增加计数器 */

Source from the content-addressed store, hash-verified

32 * @brief 线程函数,增加计数器
33 */
34void thread_increment(void* arg) {
35 uint64_t thread_id = reinterpret_cast<uint64_t>(arg);
36
37 for (int i = 0; i < 10; ++i) {
38 g_thread_counter++;
39 klog::Debug("Thread {}: counter={}, iter={}", thread_id,
40 g_thread_counter.load(), i);
41 (void)sys_sleep(10);
42 }
43
44 g_thread_completed++;
45 klog::Info("Thread {}: completed", thread_id);
46 sys_exit(0);
47}
48
49/**
50 * @brief 测试线程组的基本功能

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected