File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -220,9 +220,10 @@ namespace dynamicgraph
220220 }
221221
222222 // lock the mutex to avoid deleting the signal during a call to trigger
223+ boost::mutex::scoped_lock lock (mutex_);
224+
223225 signalDeregistration (signal);
224226 bindedSignal_.erase (signal);
225- mutex_.unlock ();
226227 }
227228
228229 std::string RosPublish::list () const
@@ -262,13 +263,14 @@ namespace dynamicgraph
262263
263264 nextPublication_ = ros::Time::now () + rate_;
264265
266+ boost::mutex::scoped_lock lock (mutex_);
267+
265268 while (! mutex_.try_lock () ){}
266269 for (iterator_t it = bindedSignal_.begin ();
267270 it != bindedSignal_.end (); ++it)
268271 {
269272 boost::get<1 >(it->second ) (t);
270273 }
271- mutex_.unlock ();
272274 return dummy;
273275 }
274276
Original file line number Diff line number Diff line change 44
55# include < boost/shared_ptr.hpp>
66# include < boost/tuple/tuple.hpp>
7- # include < boost/interprocess/sync/interprocess_mutex .hpp>
7+ # include < boost/thread/mutex .hpp>
88
99# include < dynamic-graph/entity.h>
1010# include < dynamic-graph/signal-time-dependent.h>
@@ -94,7 +94,7 @@ namespace dynamicgraph
9494 dynamicgraph::SignalTimeDependent<int ,int > trigger_;
9595 ros::Duration rate_;
9696 ros::Time nextPublication_;
97- boost::interprocess::interprocess_mutex mutex_;
97+ boost::mutex mutex_;
9898 };
9999} // end of namespace dynamicgraph.
100100
You can’t perform that action at this time.
0 commit comments