Skip to content

Commit

Permalink
Refs 16192. Allowing wait without previous notification
Browse files Browse the repository at this point in the history
Signed-off-by: Miguel Barro <miguelbarro@eprosima.com>
  • Loading branch information
Miguel Barro committed Nov 21, 2022
1 parent b95d811 commit aa260da
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/cpp/fastdds/core/condition/WaitSetImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ ReturnCode_t WaitSetImpl::wait(
{
std::unique_lock<std::mutex> lock(mutex_);
// last notification processed
unsigned int old_counter = 0;
unsigned int old_counter = notifications_ - 1;

if (is_waiting_)
{
Expand Down
2 changes: 1 addition & 1 deletion src/cpp/fastdds/core/condition/WaitSetImpl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ struct WaitSetImpl
std::condition_variable cond_;
eprosima::utilities::collections::unordered_vector<const Condition*> entries_;
bool is_waiting_ = false;
std::atomic_uint notifications_ = {0};
std::atomic_uint notifications_ = {1};
};

} // namespace detail
Expand Down

0 comments on commit aa260da

Please sign in to comment.