Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <thread>
- #include <sstream>
- void f1() {
- for(;;) {
- std::stringstream stream;
- stream << "f1" << std::endl;
- std::cout << stream.str();
- }
- }
- void f2() {
- for(;;) {
- std::stringstream stream;
- stream << "f1" << std::endl;
- std::cout << stream.str();
- }
- }
- int main() {
- std::thread t1(f1);
- std::thread t2(f2);
- t1.join(); t2.join();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement