C++ Join thread
#include <iostream>
#include <thread>
void threadFunction(int threadID) {
std::cout << "Thread " << threadID << " is running." << std::endl;
}
int main() {
// Create thread objects
std::thread thread1(threadFunction, 1);
std::thread thread2(threadFunction, 2);
// Wait for threads to finish
thread1.join();
thread2.join();
return 0;
}