std 中有thread库,可以直接使用。如果线程的函数是一个成员函数,需要在thread中加入this变量,如:thread th (&testclass::th_fun, this, args...);
cpp class中使用线程
最新推荐文章于 2023-04-28 16:03:23 发布
std 中有thread库,可以直接使用。如果线程的函数是一个成员函数,需要在thread中加入this变量,如:thread th (&testclass::th_fun, this, args...);