我发现this example;在这里,两个线程threadDefault和threadCustomized通过使用pthread_exit终止,然后使用return终止。作者为什么要同时写这两个说明?
最佳答案
Mohith Reddy的答案是正确的,但没有指出重点。当然,由于pthread_exit
不返回,因此从不执行return语句,但是在不知道pthread_exit
不返回的情况下,它可以抑制来自编译器的警告。
关于c - 使用pthread_exit终止并返回的线程终止-奇怪的示例,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62652921/