https://computing.llnl.gov/tutorials/pthreads/samples/join.c
请参阅上面链接中的代码。
- 在 main() 中的 pthread_join 之后执行 pthread_exit 有什么好处吗?
https://computing.llnl.gov/tutorials/pthreads/samples/join.c
请参阅上面链接中的代码。
从 的 POSIX 规范来看,使用 or代替or orpthread_exit()并没有太大的好处。名义上,这意味着处理程序没有被执行,它可能意味着文件流没有被刷新——更像. 在示例代码的上下文中,这似乎是不必要的。pthread_exit()exit()_exit()returnatexit()_exit()