我有这个代码:
void* ConfigurationHandler::sendThreadFunction(void* callbackData)
{
const EventData* eventData = (const EventData*)(callbackData);
//Do Something
return NULL;
}
void ConfigurationHandler::sendCancel()
{
EventData* eventData = new EventData();
eventData ->Name = "BLABLA"
pthread_t threadId = 0;
int ret = pthread_create(&threadId,
NULL,
ConfigurationHandler::sendThreadFunction,
(void*) eventData ); // args passed to thread function
if (ret)
{
log("Failed to launch thread!\n");
}
else
{
ret = pthread_detach(threadId);
}
}
我收到编译器错误:
error: argument of type 'void* (ConfigurationHandler::)(void*)' does not match 'void* (*)(void*)'