成员函数做 线程函数, 认不出 参数 ,“(nil)” ?
void* SomeClass::NoneStaticThreadFunc(void* param)
{
printf("param=[%p],this=[%p] \n", param, this);
return NULL;
}
void SomeClass::InvokNoneStaticThreadFunc()
{
pthread_t tid;
pthread_create(&tid, NULL, (void* (*) (void*))&SomeClass::NoneStaticThreadFunc, this);
}
打印结果: param=[(nil)], this=[0x7fff44cae060].
为什么打印 param 是 “(nil)” ???