C++ 如果不使用',是否需要pthread_exit;不在乎回报值
如果我不关心线程的返回状态,我是否需要pthread_退出 我想知道在我的datached pthread中不调用pthread_exit是否会有一些微妙的资源问题C++ 如果不使用',是否需要pthread_exit;不在乎回报值,c++,c,pthreads,C++,C,Pthreads,如果我不关心线程的返回状态,我是否需要pthread_退出 我想知道在我的datached pthread中不调用pthread_exit是否会有一些微妙的资源问题 谢谢。您不必调用pthread\u exit()。从线程函数返回同样有效,并且不会泄漏任何资源(当然,您仍然必须确保代码没有任何泄漏)。目的pthread\u exit()是在任何其他线程加入时返回退出代码 从: 所以,不使用它也没什么区别。阅读手册 Performing a return from the start fun
谢谢。您不必调用
pthread\u exit()
。从线程函数返回同样有效,并且不会泄漏任何资源(当然,您仍然必须确保代码没有任何泄漏)。目的pthread\u exit()
是在任何其他线程加入时返回退出代码
从:
所以,不使用它也没什么区别。阅读手册
Performing a return from the start function of any thread other than the main
thread results in an implicit call to pthread_exit(), using the function's
return value as the thread's exit status.