What’s the best way to delete boost::thread object right after its work is complete?

后端 未结 4 747
伪装坚强ぢ
伪装坚强ぢ 2020-12-06 16:43

I create boost::thread object with a new operator and continue without waiting this thread to finish its work:

void do_work()
{
            


        
4条回答
  •  盖世英雄少女心
    2020-12-06 17:24

    You should take a look at thread interruption.

    This article is good also.

    http://www.boost.org/doc/libs/1_38_0/doc/html/thread/thread_management.html

提交回复
热议问题