美文网首页
join failed: no such process

join failed: no such process

作者: 妖精不语 | 来源:发表于2018-04-27 11:37 被阅读0次
      if (m_executeThread.joinable())
        {
            m_executeThread.join();
        }

在执行到以上代码的时候,偶尔会出现join failed: no such process错误。百思不得其解。后发现,是内存踩坏了。

bool joinable() const _NOEXCEPT {return __t_ != 0;}

joinable函数仅仅是判断了__t_是否会空, 如果内存被踩坏,则__t_不会空。但并不指向一个正确的线程。所以引起该错误。

相关文章

网友评论

      本文标题:join failed: no such process

      本文链接:https://www.haomeiwen.com/subject/fzdblftx.html