Create Threads in a loop

后端 未结 5 1332
难免孤独
难免孤独 2021-01-14 02:08

I just tested something like this:

boost::thread workerThread1(boost::bind(&Class::Function, this, ...);
boost::thread workerThread2(boost::bind(&Cla         


        
5条回答
  •  佛祖请我去吃肉
    2021-01-14 03:12

    Why not put the threads into their own container, such as a vector (by smart pointer assuming they're non-copyable)?

提交回复
热议问题