#include<thread>
void listenThread() {
// 线程1内容
}
void sendThread() {
// 线程2内容
}
int main() {
std::thread sendThreadObj(sendThread);
std::thread listenThreadObj(listenThread);
listenThreadObj.join();
sendThreadObj.join();
return 0;
}
Open multi-thread template in C++
Guess you like
Origin blog.csdn.net/gls_nuaa/article/details/131499444
Recommended
Ranking