c++11线程使用

1创建句柄

std::thread	*pjhandle;

2创建线程工作函数

void thread(LPVOID Param)
{
    
    
	type *pThis = (type*)Param;
	pThis->do();
}

3创建线程要做的事

void do()
{
    
    
	............
}

4创建对象

pjhandle = new std::thread(thread, this);

5等待线程退出并回收

pjhandle->join();

猜你喜欢

转载自blog.csdn.net/Fengfgg/article/details/113103638