Advertisement
Guest User

Untitled

a guest
Jun 1st, 2018
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. #include <utility>
  2. #include <thread>
  3. #include <cstdlib>
  4. #include <unistd.h>
  5. #include <memory>
  6.  
  7.  
  8. void foo()
  9. {
  10.  
  11. }
  12. void bar()
  13. {
  14. std::unique_ptr<std::thread> p = std::make_unique<std::thread>(foo);
  15. fork();
  16. p->join();
  17. }
  18.  
  19. int main(int argc, char *argv[])
  20. {
  21. bar();
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement