Skip to content

Commit

Permalink
Modified oneliners. Reverted atomic_bools
Browse files Browse the repository at this point in the history
Signed-off-by: Javier Santiago <[email protected]>
  • Loading branch information
jsan-rt committed Jul 11, 2022
1 parent 8fc0aa9 commit e71cbd2
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -123,26 +123,22 @@ class PubListener : public EventListenerInterface, public eprosima::fastdds::dds
private:
CustomPublisherInfo * publisher_info_ = nullptr;

std::set<eprosima::fastrtps::rtps::GUID_t> subscriptions_
RCPPUTILS_TSA_GUARDED_BY(
discovery_m_);
mutable std::mutex discovery_m_;

std::mutex discovery_m_;
std::set<eprosima::fastrtps::rtps::GUID_t> subscriptions_
RCPPUTILS_TSA_GUARDED_BY(discovery_m_);

bool deadline_changes_;
std::atomic_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_;
std::atomic_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_;
std::atomic_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_
Original file line number Diff line number Diff line change
Expand Up @@ -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_;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,28 +169,24 @@ class SubListener : public EventListenerInterface, public eprosima::fastdds::dds
private:
CustomSubscriberInfo * subscriber_info_ = nullptr;

bool deadline_changes_;
std::atomic_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_;
std::atomic_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_;
std::atomic_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_;
std::atomic_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<eprosima::fastrtps::rtps::GUID_t> publishers_ RCPPUTILS_TSA_GUARDED_BY(
internalMutex_);
discovery_m_);

rmw_event_callback_t on_new_message_cb_{nullptr};

Expand Down
3 changes: 1 addition & 2 deletions rmw_fastrtps_shared_cpp/src/rmw_take.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -438,8 +438,7 @@ struct LoanManager
private:
std::mutex mtx;
using ItemVector = eprosima::fastrtps::ResourceLimitedVector<std::unique_ptr<Item>>;
ItemVector items RCPPUTILS_TSA_GUARDED_BY(
mtx);
ItemVector items RCPPUTILS_TSA_GUARDED_BY(mtx);
};

void
Expand Down

0 comments on commit e71cbd2

Please sign in to comment.