]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/thread/test/test_5542_3.cpp
1 // Copyright (C) 2010 Vicente Botet
3 // Distributed under the Boost Software License, Version 1.0. (See accompanying
4 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6 #define BOOST_THREAD_VERSION 2
9 #include <boost/thread/thread_only.hpp>
10 #include <boost/date_time.hpp>
14 boost::posix_time::seconds
workTime(3);
16 std::cout
<< "Worker: running" << std::endl
;
18 // Pretend to do something useful...
19 boost::this_thread::sleep(workTime
);
21 std::cout
<< "Worker: finished" << std::endl
;
26 std::cout
<< "main: startup" << std::endl
;
28 boost::thread
workerThread(workerFunc
);
30 std::cout
<< "main: waiting for thread" << std::endl
;
34 std::cout
<< "main: done" << std::endl
;