/* * File: main.cpp * Author: eshubin * * Created on 28 Июль 2010 г., 13:21 */ #include #include using namespace std; void ThreadFun(int number) { sleep(5); } int main(int argc, char** argv) { if (argc > 1) { pid_t pid = fork(); if (pid < 0) { return EXIT_FAILURE; } else if (pid > 0) { return EXIT_SUCCESS; } } boost::thread th1(boost::bind(&ThreadFun, 1)); th1.join(); return EXIT_SUCCESS; }