fix possible race condition per ticket #3802
git-svn-id: https://code.ros.org/svn/ros-pkg/stacks/laser_pipeline/trunk@27698 eb33c2ac-9c88-4c90-87e0-44a10359b0c3
This commit is contained in:
parent
735e86948f
commit
81bcc63259
|
|
@ -35,6 +35,7 @@
|
|||
#include <sstream>
|
||||
|
||||
#include "boost/numeric/ublas/matrix.hpp"
|
||||
#include "boost/thread/mutex.hpp"
|
||||
|
||||
#include "tf/tf.h"
|
||||
|
||||
|
|
@ -234,6 +235,7 @@ namespace laser_geometry
|
|||
//! Internal map of pointers to stored values
|
||||
std::map<std::string,boost::numeric::ublas::matrix<double>* > unit_vector_map_;
|
||||
|
||||
boost::mutex guv_mutex_;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -152,6 +152,8 @@ namespace laser_geometry
|
|||
|
||||
const boost::numeric::ublas::matrix<double>& LaserProjection::getUnitVectors_(double angle_min, double angle_max, double angle_increment, unsigned int length)
|
||||
{
|
||||
boost::mutex::scoped_lock guv_lock(this->guv_mutex_);
|
||||
|
||||
//construct string for lookup in the map
|
||||
std::stringstream anglestring;
|
||||
anglestring <<angle_min<<","<<angle_max<<","<<angle_increment<<","<<length;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user