From ec7a5761483fe6b2429071568a25c4260d13876b Mon Sep 17 00:00:00 2001 From: Javier Santiago Date: Mon, 11 Jul 2022 07:29:36 +0200 Subject: [PATCH] Modified oneliners. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Javier Santiago Signed-off-by: Ricardo González Moreno --- .../custom_publisher_info.hpp | 16 ++++++---------- .../custom_service_info.hpp | 6 ++---- .../custom_subscriber_info.hpp | 14 +++++--------- rmw_fastrtps_shared_cpp/src/rmw_take.cpp | 3 +-- 4 files changed, 14 insertions(+), 25 deletions(-) diff --git a/rmw_fastrtps_shared_cpp/include/rmw_fastrtps_shared_cpp/custom_publisher_info.hpp b/rmw_fastrtps_shared_cpp/include/rmw_fastrtps_shared_cpp/custom_publisher_info.hpp index 3e7282fa1..38fe45be5 100644 --- a/rmw_fastrtps_shared_cpp/include/rmw_fastrtps_shared_cpp/custom_publisher_info.hpp +++ b/rmw_fastrtps_shared_cpp/include/rmw_fastrtps_shared_cpp/custom_publisher_info.hpp @@ -123,26 +123,22 @@ class PubListener : public EventListenerInterface, public eprosima::fastdds::dds private: CustomPublisherInfo * publisher_info_ = nullptr; - std::set subscriptions_ - RCPPUTILS_TSA_GUARDED_BY( - discovery_m_); + mutable std::mutex discovery_m_; - std::mutex discovery_m_; + std::set subscriptions_ + RCPPUTILS_TSA_GUARDED_BY(discovery_m_); bool deadline_changes_; eprosima::fastdds::dds::OfferedDeadlineMissedStatus offered_deadline_missed_status_ - RCPPUTILS_TSA_GUARDED_BY( - on_new_event_m_); + RCPPUTILS_TSA_GUARDED_BY(on_new_event_m_); bool liveliness_changes_; eprosima::fastdds::dds::LivelinessLostStatus liveliness_lost_status_ - RCPPUTILS_TSA_GUARDED_BY( - on_new_event_m_); + RCPPUTILS_TSA_GUARDED_BY(on_new_event_m_); bool incompatible_qos_changes_; eprosima::fastdds::dds::OfferedIncompatibleQosStatus incompatible_qos_status_ - RCPPUTILS_TSA_GUARDED_BY( - on_new_event_m_); + RCPPUTILS_TSA_GUARDED_BY(on_new_event_m_); }; #endif // RMW_FASTRTPS_SHARED_CPP__CUSTOM_PUBLISHER_INFO_HPP_ diff --git a/rmw_fastrtps_shared_cpp/include/rmw_fastrtps_shared_cpp/custom_service_info.hpp b/rmw_fastrtps_shared_cpp/include/rmw_fastrtps_shared_cpp/custom_service_info.hpp index 4d04c06e4..883a6a7ad 100644 --- a/rmw_fastrtps_shared_cpp/include/rmw_fastrtps_shared_cpp/custom_service_info.hpp +++ b/rmw_fastrtps_shared_cpp/include/rmw_fastrtps_shared_cpp/custom_service_info.hpp @@ -177,10 +177,8 @@ class ServicePubListener : public eprosima::fastdds::dds::DataWriterListener private: std::mutex mutex_; - subscriptions_set_t subscriptions_ RCPPUTILS_TSA_GUARDED_BY( - mutex_); - clients_endpoints_map_t clients_endpoints_ RCPPUTILS_TSA_GUARDED_BY( - mutex_); + subscriptions_set_t subscriptions_ RCPPUTILS_TSA_GUARDED_BY(mutex_); + clients_endpoints_map_t clients_endpoints_ RCPPUTILS_TSA_GUARDED_BY(mutex_); std::condition_variable cv_; }; diff --git a/rmw_fastrtps_shared_cpp/include/rmw_fastrtps_shared_cpp/custom_subscriber_info.hpp b/rmw_fastrtps_shared_cpp/include/rmw_fastrtps_shared_cpp/custom_subscriber_info.hpp index 3945c3fe2..ee9464e02 100644 --- a/rmw_fastrtps_shared_cpp/include/rmw_fastrtps_shared_cpp/custom_subscriber_info.hpp +++ b/rmw_fastrtps_shared_cpp/include/rmw_fastrtps_shared_cpp/custom_subscriber_info.hpp @@ -171,26 +171,22 @@ class SubListener : public EventListenerInterface, public eprosima::fastdds::dds bool deadline_changes_; eprosima::fastdds::dds::RequestedDeadlineMissedStatus requested_deadline_missed_status_ - RCPPUTILS_TSA_GUARDED_BY( - on_new_event_m_); + RCPPUTILS_TSA_GUARDED_BY(on_new_event_m_); bool liveliness_changes_; eprosima::fastdds::dds::LivelinessChangedStatus liveliness_changed_status_ - RCPPUTILS_TSA_GUARDED_BY( - on_new_event_m_); + RCPPUTILS_TSA_GUARDED_BY(on_new_event_m_); bool sample_lost_changes_; eprosima::fastdds::dds::SampleLostStatus sample_lost_status_ - RCPPUTILS_TSA_GUARDED_BY( - on_new_event_m_); + RCPPUTILS_TSA_GUARDED_BY(on_new_event_m_); bool incompatible_qos_changes_; eprosima::fastdds::dds::RequestedIncompatibleQosStatus incompatible_qos_status_ - RCPPUTILS_TSA_GUARDED_BY( - discovery_m_); + RCPPUTILS_TSA_GUARDED_BY(discovery_m_); std::set publishers_ RCPPUTILS_TSA_GUARDED_BY( - internalMutex_); + discovery_m_); rmw_event_callback_t on_new_message_cb_{nullptr}; diff --git a/rmw_fastrtps_shared_cpp/src/rmw_take.cpp b/rmw_fastrtps_shared_cpp/src/rmw_take.cpp index 89ba122ce..c03d46b36 100644 --- a/rmw_fastrtps_shared_cpp/src/rmw_take.cpp +++ b/rmw_fastrtps_shared_cpp/src/rmw_take.cpp @@ -438,8 +438,7 @@ struct LoanManager private: std::mutex mtx; using ItemVector = eprosima::fastrtps::ResourceLimitedVector>; - ItemVector items RCPPUTILS_TSA_GUARDED_BY( - mtx); + ItemVector items RCPPUTILS_TSA_GUARDED_BY(mtx); }; void