Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <utility>
- #include <thread>
- #include <cstdlib>
- #include <unistd.h>
- #include <memory>
- void foo()
- {
- }
- void bar()
- {
- std::unique_ptr<std::thread> p = std::make_unique<std::thread>(foo);
- fork();
- p->join();
- }
- int main(int argc, char *argv[])
- {
- bar();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement