Skip to content

Commit

Permalink
Fix wrong usage of condition_variable (#2039)
Browse files Browse the repository at this point in the history
Signed-off-by: Ricardo González Moreno <ricardo@richiware.dev>
Signed-off-by: Miguel Company <miguelcompany@eprosima.com>
  • Loading branch information
MiguelCompany committed Jul 2, 2021
1 parent 8c381ac commit 9ee08b8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion test/blackbox/api/dds-pim/PubSubReader.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,10 @@ class PubSubReader
eprosima::fastdds::dds::DataReader* datareader) override
{
ASSERT_NE(datareader, nullptr);
reader_.message_receive_count_.fetch_add(1);
{
std::lock_guard<std::mutex> guard(reader_.message_receive_mutex_);
reader_.message_receive_count_.fetch_add(1);
}
reader_.message_receive_cv_.notify_one();

if (reader_.receiving_.load())
Expand Down

0 comments on commit 9ee08b8

Please sign in to comment.