File tree Expand file tree Collapse file tree 2 files changed +13
-7
lines changed
test/performance/throughput Expand file tree Collapse file tree 2 files changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -166,13 +166,14 @@ class ThroughputPublisher
166
166
class DataWriterListener : public eprosima ::fastdds::dds::DataWriterListener
167
167
{
168
168
ThroughputPublisher& throughput_publisher_;
169
- int matched_ = 0 ;
169
+ std::atomic_int matched_;
170
170
171
171
public:
172
172
173
173
DataWriterListener (
174
174
ThroughputPublisher& throughput_publisher)
175
175
: throughput_publisher_(throughput_publisher)
176
+ , matched_(0 )
176
177
{
177
178
}
178
179
@@ -197,13 +198,14 @@ class ThroughputPublisher
197
198
class CommandWriterListener : public eprosima ::fastdds::dds::DataWriterListener
198
199
{
199
200
ThroughputPublisher& throughput_publisher_;
200
- int matched_ = 0 ;
201
+ std::atomic_int matched_;
201
202
202
203
public:
203
204
204
205
CommandWriterListener (
205
206
ThroughputPublisher& throughput_publisher)
206
207
: throughput_publisher_(throughput_publisher)
208
+ , matched_(0 )
207
209
{
208
210
}
209
211
@@ -227,13 +229,14 @@ class ThroughputPublisher
227
229
class CommandReaderListener : public eprosima ::fastdds::dds::DataReaderListener
228
230
{
229
231
ThroughputPublisher& throughput_publisher_;
230
- int matched_ = 0 ;
232
+ std::atomic_int matched_;
231
233
232
234
public:
233
235
234
236
CommandReaderListener (
235
237
ThroughputPublisher& throughput_publisher)
236
238
: throughput_publisher_(throughput_publisher)
239
+ , matched_(0 )
237
240
{
238
241
}
239
242
Original file line number Diff line number Diff line change @@ -144,14 +144,15 @@ class ThroughputSubscriber
144
144
uint32_t last_seq_num_ = 0 ;
145
145
uint32_t lost_samples_ = 0 ;
146
146
eprosima::fastdds::dds::SampleInfo info_;
147
- int matched_ = 0 ;
148
- bool enable_ = false ;
147
+ std::atomic_int matched_;
148
+ std::atomic_bool enable_;
149
149
150
150
public:
151
151
152
152
DataReaderListener (
153
153
ThroughputSubscriber& throughput_subscriber)
154
154
: throughput_subscriber_(throughput_subscriber)
155
+ , matched_(0 )
155
156
{
156
157
}
157
158
@@ -182,13 +183,14 @@ class ThroughputSubscriber
182
183
class CommandReaderListener : public eprosima ::fastdds::dds::DataReaderListener
183
184
{
184
185
ThroughputSubscriber& throughput_subscriber_;
185
- int matched_ = 0 ;
186
+ std::atomic_int matched_;
186
187
187
188
public:
188
189
189
190
CommandReaderListener (
190
191
ThroughputSubscriber& throughput_subscriber)
191
192
: throughput_subscriber_(throughput_subscriber)
193
+ , matched_(0 )
192
194
{
193
195
}
194
196
@@ -212,13 +214,14 @@ class ThroughputSubscriber
212
214
class CommandWriterListener : public eprosima ::fastdds::dds::DataWriterListener
213
215
{
214
216
ThroughputSubscriber& throughput_subscriber_;
215
- int matched_ = 0 ;
217
+ std::atomic_int matched_;
216
218
217
219
public:
218
220
219
221
CommandWriterListener (
220
222
ThroughputSubscriber& throughput_subscriber)
221
223
: throughput_subscriber_(throughput_subscriber)
224
+ , matched_(0 )
222
225
{
223
226
}
224
227
You can’t perform that action at this time.
0 commit comments