29 #ifndef VIGIR_FOOTSTEP_PLANNING_THREADING_WORKER_H__ 30 #define VIGIR_FOOTSTEP_PLANNING_THREADING_WORKER_H__ 34 #include <boost/thread.hpp> 59 ROS_INFO_STREAM(
"[Worker (" << boost::this_thread::get_id() <<
")] Destruct");
65 ROS_INFO_STREAM(
"[Worker (" << boost::this_thread::get_id() <<
")] Start request");
72 ROS_INFO_STREAM(
"[Worker (" << boost::this_thread::get_id() <<
")] Stop request");
91 void run(
unsigned int n)
93 ROS_INFO_STREAM(
"[Worker (" << boost::this_thread::get_id() <<
")] Started with " << n <<
" jobs per thread.");
94 std::vector<boost::shared_ptr<T> > jobs;
97 queue.waitAndDequeueJobs(jobs, n);
103 ROS_DEBUG_STREAM(
"[Worker (" << boost::this_thread::get_id() <<
")] Deqeued " << jobs.size() <<
" jobs.");
104 for (
size_t i = 0; i < jobs.size() &&
run_jobs; i++)
106 boost::this_thread::interruption_point();
113 queue.justFinishedJobs(jobs.size());
116 ROS_INFO_STREAM(
"[Worker (" << boost::this_thread::get_id() <<
")] Stopped!");
#define ROS_DEBUG_STREAM(args)
#define ROS_INFO_STREAM(args)