#include<thread>
void listenThread() {
// 线程1内容
}
void sendThread() {
// 线程2内容
}
int main() {
std::thread sendThreadObj(sendThread);
std::thread listenThreadObj(listenThread);
listenThreadObj.join();
sendThreadObj.join();
return 0;
}
C++中开多线程模板
最新推荐文章于 2024-08-08 11:03:37 发布