boost线程池库的问题

发布于 2024-08-10 06:54:58 字数 3467 浏览 3 评论 0原文

我想使用开源的 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

浅沫记忆 2024-08-17 06:54:58

似乎它与您安装的 boost 版本不兼容。你有什么版本的Boost?

Seems like it's not compatible with boost version you have installed. What Boost version you have?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文