* @brief 测试线程组成员同时退出 */
| 179 | * @brief 测试线程组成员同时退出 |
| 180 | */ |
| 181 | void concurrent_exit_worker(void* arg) { |
| 182 | uint64_t thread_id = reinterpret_cast<uint64_t>(arg); |
| 183 | |
| 184 | // 执行一些工作 |
| 185 | for (int i = 0; i < 5; ++i) { |
| 186 | klog::Debug("ConcurrentExitWorker {}: iter={}", thread_id, i); |
| 187 | (void)sys_sleep(20); |
| 188 | } |
| 189 | |
| 190 | klog::Info("ConcurrentExitWorker {}: exiting", thread_id); |
| 191 | g_thread_completed++; |
| 192 | sys_exit(0); |
| 193 | } |
| 194 | |
| 195 | void test_thread_group_concurrent_exit(void* /*arg*/) { |
| 196 | klog::Info("=== Thread Group Concurrent Exit Test ==="); |