#include #include #include boost::interprocess::interprocess_semaphore sem(0); void thr1() { sem.wait(); } int main() { boost::thread t1(thr1); sleep(10); sem.post(); t1.join(); return 0; }