-
Notifications
You must be signed in to change notification settings - Fork 939
[24604] Fix minor dataraces #6422
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
d863c2d
1da68c1
c401a68
c1c11c2
99bd482
5e92a8b
9812b79
5c2bf58
4ffb1e5
d9409d3
7ff07f8
6a1d6a6
93e77d7
57f3b03
0206be3
7a182a5
1496265
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -1924,7 +1924,7 @@ class PubSubReader | |||||
| return status; | ||||||
| } | ||||||
|
|
||||||
| const eprosima::fastdds::dds::LivelinessChangedStatus& liveliness_changed_status() | ||||||
| eprosima::fastdds::dds::LivelinessChangedStatus liveliness_changed_status() | ||||||
| { | ||||||
| std::unique_lock<std::mutex> lock(liveliness_mutex_); | ||||||
|
|
||||||
|
|
@@ -1973,6 +1973,7 @@ class PubSubReader | |||||
|
|
||||||
| unsigned int get_participants_matched() const | ||||||
| { | ||||||
| std::unique_lock<std::mutex> lock(mutexDiscovery_); | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Take the chance to also change it in other places. |
||||||
| return participant_matched_; | ||||||
| } | ||||||
|
|
||||||
|
|
@@ -2272,7 +2273,7 @@ class PubSubReader | |||||
| std::list<type> total_msgs_; | ||||||
| std::mutex mutex_; | ||||||
| std::condition_variable cv_; | ||||||
| std::mutex mutexDiscovery_; | ||||||
| mutable std::mutex mutexDiscovery_; | ||||||
| std::condition_variable cvDiscovery_; | ||||||
| std::atomic<unsigned int> matched_; | ||||||
| unsigned int participant_matched_; | ||||||
|
|
@@ -2576,7 +2577,7 @@ class PubSubReaderWithWaitsets : public PubSubReader<TypeSupport> | |||||
| eprosima::fastdds::dds::GuardCondition guard_condition_; | ||||||
|
|
||||||
| //! Number of times deadline was missed | ||||||
| unsigned int times_deadline_missed_ = 0; | ||||||
| std::atomic<unsigned int> times_deadline_missed_ {0}; | ||||||
|
|
||||||
| //! The timeout for the wait operation | ||||||
| eprosima::fastdds::dds::Duration_t timeout_; | ||||||
|
|
@@ -2601,6 +2602,7 @@ class PubSubReaderWithWaitsets : public PubSubReader<TypeSupport> | |||||
|
|
||||||
| ~PubSubReaderWithWaitsets() override | ||||||
| { | ||||||
| waitset_thread_.stop(); | ||||||
| } | ||||||
|
|
||||||
| void createSubscriber() override | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -20,6 +20,7 @@ | |||||
| #ifndef _TEST_BLACKBOX_PUBSUBWRITER_HPP_ | ||||||
| #define _TEST_BLACKBOX_PUBSUBWRITER_HPP_ | ||||||
|
|
||||||
| #include <atomic> | ||||||
| #include <condition_variable> | ||||||
| #include <list> | ||||||
| #include <map> | ||||||
|
|
@@ -1794,6 +1795,7 @@ class PubSubWriter | |||||
|
|
||||||
| unsigned int get_participants_matched() const | ||||||
| { | ||||||
| std::unique_lock<std::mutex> lock(mutexDiscovery_); | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| return participant_matched_; | ||||||
| } | ||||||
|
|
||||||
|
|
@@ -2208,7 +2210,7 @@ class PubSubWriter | |||||
| eprosima::fastdds::rtps::GUID_t datawriter_guid_; | ||||||
| bool initialized_; | ||||||
| bool use_domain_id_from_profile_; | ||||||
| std::mutex mutexDiscovery_; | ||||||
| mutable std::mutex mutexDiscovery_; | ||||||
| std::condition_variable cv_; | ||||||
| std::atomic<unsigned int> matched_; | ||||||
| unsigned int participant_matched_; | ||||||
|
|
@@ -2420,10 +2422,10 @@ class PubSubWriterWithWaitsets : public PubSubWriter<TypeSupport> | |||||
| eprosima::fastdds::dds::GuardCondition guard_condition_; | ||||||
|
|
||||||
| //! The number of times deadline was missed | ||||||
| unsigned int times_deadline_missed_ = 0; | ||||||
| std::atomic<unsigned int> times_deadline_missed_ {0}; | ||||||
|
|
||||||
| //! The number of times liveliness was lost | ||||||
| unsigned int times_liveliness_lost_ = 0; | ||||||
| std::atomic<unsigned int> times_liveliness_lost_ {0}; | ||||||
|
|
||||||
| //! The timeout for the wait operation | ||||||
| eprosima::fastdds::dds::Duration_t timeout_; | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change these into
FASTDDS_TODO_BEFORE(4, 0, ...)