orocos-toolchain / rtt

Orocos Real-Time Toolkit
http://www.orocos.org
Other
72 stars 79 forks source link

Fix multi-signal emission in case of fused functor data source callbacks #293

Open meyerj opened 5 years ago

meyerj commented 5 years ago

This is a bunch of patches in toolchain-2.9 that have not yet been on any pull request so far:

From https://github.com/orocos-toolchain/rtt/commit/619fce27b36bfb5abaaeb68ba9ba8fb1683747aa (by @psoetens):

signals: fix multi-signal emission in case of fused functor data source callbacks

When an operation was called twice in a row, and a signal callback was installed using datasource semantics (with produceSignal() ), both callbacks would most likely receive twice the same data, being equal to the last operation call's values, since before the callbacks are dispatched, the data sources are already filled in. The last write wins and the first call-back sees the data of the last.

This patch fixes that by defining a data_store_type in create_sequence with a store() and a load() function. The fused signal callback can now first store the args of the operation, then dispatch and retrieve them later on in the callback function.

A later patch removed the new DataStore<T> class defined in CreateSequence.hpp again. Instead we use AStore<T> already defined in BindStorage.hpp involved in operation calls.

The last patch, https://github.com/orocos-toolchain/rtt/commit/ca0c42bab65f2696a304ea6935fda13a902e1c6e, removes a using namespace std directive in FusedFunctorDataSource.hpp, probably a leftover from debugging https://github.com/orocos-toolchain/rtt/commit/619fce27b36bfb5abaaeb68ba9ba8fb1683747aa. This commit was cherry-picked directly to toolchain-2.9 as 23f826a95b986641c70226f9ee50874a4f0d201e.