]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/thread/example/thread_pool.cpp
1 // Copyright (C) 2012-2013 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 #include <boost/config.hpp>
8 #define BOOST_THREAD_VERSION 4
9 //#define BOOST_THREAD_USES_LOG
10 #define BOOST_THREAD_USES_LOG_THREAD_ID
11 #define BOOST_THREAD_QUEUE_DEPRECATE_OLD
12 #if ! defined BOOST_NO_CXX11_DECLTYPE
13 #define BOOST_RESULT_OF_USE_DECLTYPE
16 #include <boost/thread/detail/log.hpp>
17 #include <boost/thread/executors/basic_thread_pool.hpp>
18 #include <boost/assert.hpp>
22 #pragma warning(disable: 4127) // conditional expression is constant
28 << boost::this_thread::get_id() << " P1" << BOOST_THREAD_END_LOG
;
34 << boost::this_thread::get_id() << " P2" << BOOST_THREAD_END_LOG
;
37 void submit_some(boost::basic_thread_pool
& tp
) {
54 << boost::this_thread::get_id() << " <MAIN" << BOOST_THREAD_END_LOG
;
58 boost::basic_thread_pool tp
;
61 catch (std::exception
& ex
)
64 << "ERRORRRRR " << ex
.what() << "" << BOOST_THREAD_END_LOG
;
70 << " ERRORRRRR exception thrown" << BOOST_THREAD_END_LOG
;
75 << boost::this_thread::get_id() << "MAIN>" << BOOST_THREAD_END_LOG
;