Skip to content

Commit

Permalink
Fix deadlock between PDP and StatefulReader (backport of #871)
Browse files Browse the repository at this point in the history
Fix deadlock between PDP and StatefulReader (backport of #871)
  • Loading branch information
richiware authored Nov 21, 2019
2 parents b5ae9e9 + b9f2f74 commit f1a41e7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/cpp/rtps/builtin/discovery/participant/PDP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -996,7 +996,7 @@ CDRMessage_t PDP::get_participant_proxy_data_serialized(Endianness_t endian)
void PDP::check_remote_participant_liveliness(
ParticipantProxyData* remote_participant)
{
std::lock_guard<std::recursive_mutex> guard(*this->mp_mutex);
std::unique_lock<std::recursive_mutex> guard(*this->mp_mutex);

if(GUID_t::unknown() != remote_participant->m_guid)
{
Expand All @@ -1007,6 +1007,7 @@ void PDP::check_remote_participant_liveliness(
std::chrono::microseconds(TimeConv::Duration_t2MicroSecondsInt64(remote_participant->m_leaseDuration));
if (now > real_lease_tm)
{
guard.unlock();
remove_remote_participant(remote_participant->m_guid, ParticipantDiscoveryInfo::DROPPED_PARTICIPANT);
return;
}
Expand Down

0 comments on commit f1a41e7

Please sign in to comment.