例子:
void start(void) { pthread_create(&threadID, Null, run_thread_function,arguments); //is there a way to ensure if the run_thread_function(basically new thread) started //execution before returning from this(start) function }
最佳答案
检查返回码。
if ((retcode = pthread_create(&threadID, Null, run_thread_function,arguments)) != 0)
{
//something went wrong
}
关于c++ - 如何验证 pthread 函数是否开始执行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13167318/