可能重复:
来自类的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)
请让我知道如何解决这个问题..
提前致谢.