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
220
220
}
221
221
222
222
// lock the mutex to avoid deleting the signal during a call to trigger
223
+ boost::mutex::scoped_lock lock (mutex_);
224
+
223
225
signalDeregistration (signal);
224
226
bindedSignal_.erase (signal);
225
- mutex_.unlock ();
226
227
}
227
228
228
229
std::string RosPublish::list () const
@@ -262,13 +263,14 @@ namespace dynamicgraph
262
263
263
264
nextPublication_ = ros::Time::now () + rate_;
264
265
266
+ boost::mutex::scoped_lock lock (mutex_);
267
+
265
268
while (! mutex_.try_lock () ){}
266
269
for (iterator_t it = bindedSignal_.begin ();
267
270
it != bindedSignal_.end (); ++it)
268
271
{
269
272
boost::get<1 >(it->second ) (t);
270
273
}
271
- mutex_.unlock ();
272
274
return dummy;
273
275
}
274
276
Original file line number Diff line number Diff line change 4
4
5
5
# include < boost/shared_ptr.hpp>
6
6
# include < boost/tuple/tuple.hpp>
7
- # include < boost/interprocess/sync/interprocess_mutex .hpp>
7
+ # include < boost/thread/mutex .hpp>
8
8
9
9
# include < dynamic-graph/entity.h>
10
10
# include < dynamic-graph/signal-time-dependent.h>
@@ -94,7 +94,7 @@ namespace dynamicgraph
94
94
dynamicgraph::SignalTimeDependent<int ,int > trigger_;
95
95
ros::Duration rate_;
96
96
ros::Time nextPublication_;
97
- boost::interprocess::interprocess_mutex mutex_;
97
+ boost::mutex mutex_;
98
98
};
99
99
} // end of namespace dynamicgraph.
100
100
You can’t perform that action at this time.
0 commit comments