相关疑难解决方法(0)

pthread在c ++中创建错误

可能重复:
来自类的pthread函数

我收到一个错误("无法转换....."),我认为pthread_create调用中的第三个参数是错误的.我知道第三个参数的类型应该是(void*)*(void*)但我仍然会收到错误.

void ServerManager::Init(){  
     pthread_t thread;
     pthread_create(&thread, NULL, AcceptLoop, (void *)this);
}
Run Code Online (Sandbox Code Playgroud)

我已经这样声明了,我试着调用下面的函数

void* ServerManager::AcceptLoop(void * delegate){

}
Run Code Online (Sandbox Code Playgroud)

请让我知道如何解决这个问题..

提前致谢.

c++ pthreads

0
推荐指数
1
解决办法
1217
查看次数

标签 统计

c++ ×1

pthreads ×1