pthread的问题很急请帮忙

fdw fdw 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
class Thread
{
....
protected:
virtual void Execute() = 0;
private:
static void * entryPoint(void* Paramer);
....
}
//创建线程
pthread_create(&m_ThreadHandle, 0, entryPoint, this);
//entryPoint 函数
void * Thread::entryPoint(void* Paramer)
{
if ( Paramer != NULL ) {
static_cast<Thread *>(Paramer)->Execute();
}
return Paramer;
}
但static_cast<Thread *>(Paramer)->Execute();出 <段错误-核心陷阱> 错误.
我用的是solaris,cc
很急的请帮我 ,一定给分.
...全文
评论 10
收藏 已收藏
分享
返回顶部
fdw
C++ 语言 65,214 成员 250,514 内容