正在显示
1 个修改的文件
包含
6 行增加
和
3 行删除
@@ -83,9 +83,6 @@ int thread_test() | @@ -83,9 +83,6 @@ int thread_test() | ||
83 | st_thread_join(trd, NULL); | 83 | st_thread_join(trd, NULL); |
84 | srs_trace("3. thread joined"); | 84 | srs_trace("3. thread joined"); |
85 | 85 | ||
86 | - st_thread_exit(NULL); | ||
87 | - srs_trace("4. all thread completed"); | ||
88 | - | ||
89 | srs_trace("thread test: end"); | 86 | srs_trace("thread test: end"); |
90 | 87 | ||
91 | return 0; | 88 | return 0; |
@@ -385,7 +382,13 @@ int main(int argc, char** argv) | @@ -385,7 +382,13 @@ int main(int argc, char** argv) | ||
385 | } | 382 | } |
386 | 383 | ||
387 | // cleanup. | 384 | // cleanup. |
385 | + srs_trace("wait for all thread completed"); | ||
388 | st_thread_exit(NULL); | 386 | st_thread_exit(NULL); |
387 | + // the following never enter, | ||
388 | + // the above code will exit when all thread exit, | ||
389 | + // current is a primordial st-thread, when all thread exit, | ||
390 | + // the st idle thread will exit(0), see _st_idle_thread_start() | ||
391 | + srs_trace("all thread completed"); | ||
389 | 392 | ||
390 | return 0; | 393 | return 0; |
391 | } | 394 | } |
-
请 注册 或 登录 后发表评论