Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/152.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/c/62.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ 如果不使用',是否需要pthread_exit;不在乎回报值_C++_C_Pthreads - Fatal编程技术网

C++ 如果不使用',是否需要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_退出

我想知道在我的datached pthread中不调用pthread_exit是否会有一些微妙的资源问题


谢谢。

您不必调用
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.