boost线程池库的问题
我想使用开源的 boost 线程池库(http://threadpool.sourceforge.net/)我在示例程序本身中遇到编译错误。
/usr/include/boost/./threadpool/./detail/locking_ptr.hpp:在构造函数 âboost::threadpool::detail::locking_ptr::locking_ptr(易失性 T&, const 易失性互斥体&) 中 [其中 T = boost: :threadpool::detail::pool_core >、boost::threadpool::fifo_scheduler、boost::threadpool::static_size、boost::threadpool::resize_controller、boost::threadpool::wait_for_all_tasks>、互斥体 = boost::recursive_mutex ]â:
/usr/include/boost/./threadpool/./detail/pool_core.hpp:331:从 âbool boost::threadpool::detail::pool_core::resize(size_t) 实例化 挥发性 [with Task = boost: :function0 >, SchedulingPolicy = boost::threadpool::fifo_scheduler, SizePolicy = boost::threadpool::static_size, SizePolicyController = boost::threadpool::resize_controller, ShutdownPolicy = boost::threadpool::wait_for_all_tasks]â
/usr/include /boost/./threadpool/size_policies.hpp:75:从 âstatic void boost::threadpool::static_size::init(Pool&, size_t) 实例化 [with Pool = boost::threadpool::detail::pool_core >, boost::threadpool::fifo_scheduler、boost::threadpool::static_size、boost::threadpool::resize_controller、boost::threadpool::wait_for_all_tasks>]â
/usr/include/boost/./threadpool/pool.hpp:103 :从 âboost::threadpool::thread_pool::thread_pool(size_t) 实例化 [with Task = boost::function0 >, SchedulingPolicy = boost::threadpool::fifo_scheduler, SizePolicy = boost::threadpool::static_size, SizePolicyController = boost ::threadpool::resize_controller, ShutdownPolicy = boost::threadpool::wait_for_all_tasks]â
./example/mergesort/mergesort.cpp:152:从此处实例化
/usr/include/boost/./threadpool/./detail/locking_ptr。 hpp:50: 错误:“class boost::recursive_mutex”没有名为“lock”的成员
/usr/include/boost/./threadpool/./detail/locking_ptr.hpp:在析构函数“boost::threadpool::detail::locking_ptr::~”中locking_ptr() [其中 T = boost::threadpool::detail::pool_core >、boost::threadpool::fifo_scheduler、boost::threadpool::static_size、boost::threadpool::resize_controller、boost::threadpool:: wait_for_all_tasks>, Mutex = boost::recursive_mutex]â:
/usr/include/boost/./threadpool/./detail/pool_core.hpp:331: 实例化自 âbool boost::threadpool::detail::pool_core::resize( size_t) 易失性 [任务 = boost::function0 >、SchedulingPolicy = boost::threadpool::fifo_scheduler、SizePolicy = boost::threadpool::static_size、SizePolicyController = boost::threadpool::resize_controller、ShutdownPolicy = boost::threadpool ::wait_for_all_tasks]â
/usr/include/boost/./threadpool/size_policies.hpp:75:从 âstatic void boost::threadpool::static_size::init(Pool&, size_t) 实例化 [with Pool = boost::threadpool ::detail::pool_core >、boost::threadpool::fifo_scheduler、boost::threadpool::static_size、boost::threadpool::resize_controller、boost::threadpool::wait_for_all_tasks>]â
/usr/include/boost/ ./threadpool/pool.hpp:103:从 âboost::threadpool::thread_pool::thread_pool(size_t) 实例化 [with Task = boost::function0 >, SchedulingPolicy = boost::threadpool::fifo_scheduler, SizePolicy = boost: :threadpool::static_size, SizePolicyController = boost::threadpool::resize_controller, ShutdownPolicy = boost::threadpool::wait_for_all_tasks]â
./example/mergesort/mergesort.cpp:152:从此处
/usr/include/boost/ 实例化。 /threadpool/./detail/locking_ptr.hpp:58: 错误:“class boost::recursive_mutex”没有名为“unlock”的成员
有人可以帮助解决这个问题吗?
问候, 阿南丹
I want to use the boost threadpool library from open source(http://threadpool.sourceforge.net/) I am getting an complilation error with the example program itself.
/usr/include/boost/./threadpool/./detail/locking_ptr.hpp: In constructor âboost::threadpool::detail::locking_ptr::locking_ptr(volatile T&, const volatile Mutex&) [with T = boost::threadpool::detail::pool_core >, boost::threadpool::fifo_scheduler, boost::threadpool::static_size, boost::threadpool::resize_controller, boost::threadpool::wait_for_all_tasks>, Mutex = boost::recursive_mutex]â:
/usr/include/boost/./threadpool/./detail/pool_core.hpp:331: instantiated from âbool boost::threadpool::detail::pool_core::resize(size_t) volatile [with Task = boost::function0 >, SchedulingPolicy = boost::threadpool::fifo_scheduler, SizePolicy = boost::threadpool::static_size, SizePolicyController = boost::threadpool::resize_controller, ShutdownPolicy = boost::threadpool::wait_for_all_tasks]â
/usr/include/boost/./threadpool/size_policies.hpp:75: instantiated from âstatic void boost::threadpool::static_size::init(Pool&, size_t) [with Pool = boost::threadpool::detail::pool_core >, boost::threadpool::fifo_scheduler, boost::threadpool::static_size, boost::threadpool::resize_controller, boost::threadpool::wait_for_all_tasks>]â
/usr/include/boost/./threadpool/pool.hpp:103: instantiated from âboost::threadpool::thread_pool::thread_pool(size_t) [with Task = boost::function0 >, SchedulingPolicy = boost::threadpool::fifo_scheduler, SizePolicy = boost::threadpool::static_size, SizePolicyController = boost::threadpool::resize_controller, ShutdownPolicy = boost::threadpool::wait_for_all_tasks]â
./example/mergesort/mergesort.cpp:152: instantiated from here
/usr/include/boost/./threadpool/./detail/locking_ptr.hpp:50: error: âclass boost::recursive_mutexâ has no member named âlockâ
/usr/include/boost/./threadpool/./detail/locking_ptr.hpp: In destructor âboost::threadpool::detail::locking_ptr::~locking_ptr() [with T = boost::threadpool::detail::pool_core >, boost::threadpool::fifo_scheduler, boost::threadpool::static_size, boost::threadpool::resize_controller, boost::threadpool::wait_for_all_tasks>, Mutex = boost::recursive_mutex]â:
/usr/include/boost/./threadpool/./detail/pool_core.hpp:331: instantiated from âbool boost::threadpool::detail::pool_core::resize(size_t) volatile [with Task = boost::function0 >, SchedulingPolicy = boost::threadpool::fifo_scheduler, SizePolicy = boost::threadpool::static_size, SizePolicyController = boost::threadpool::resize_controller, ShutdownPolicy = boost::threadpool::wait_for_all_tasks]â
/usr/include/boost/./threadpool/size_policies.hpp:75: instantiated from âstatic void boost::threadpool::static_size::init(Pool&, size_t) [with Pool = boost::threadpool::detail::pool_core >, boost::threadpool::fifo_scheduler, boost::threadpool::static_size, boost::threadpool::resize_controller, boost::threadpool::wait_for_all_tasks>]â
/usr/include/boost/./threadpool/pool.hpp:103: instantiated from âboost::threadpool::thread_pool::thread_pool(size_t) [with Task = boost::function0 >, SchedulingPolicy = boost::threadpool::fifo_scheduler, SizePolicy = boost::threadpool::static_size, SizePolicyController = boost::threadpool::resize_controller, ShutdownPolicy = boost::threadpool::wait_for_all_tasks]â
./example/mergesort/mergesort.cpp:152: instantiated from here
/usr/include/boost/./threadpool/./detail/locking_ptr.hpp:58: error: âclass boost::recursive_mutexâ has no member named âunlockâ
Can someone help to solve this issue?
Regards,
Anandan
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
似乎它与您安装的 boost 版本不兼容。你有什么版本的Boost?
Seems like it's not compatible with boost version you have installed. What Boost version you have?