Skip to content

Commit

Permalink
[core] fix tsbpd() may deadlock with processCtrlShutdown()
Browse files Browse the repository at this point in the history
  • Loading branch information
gou4shi1 authored and maxsharabayko committed Aug 9, 2023
1 parent 744035b commit 7cfe12b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions srtcore/core.cpp
Expand Up @@ -5456,6 +5456,10 @@ void * srt::CUDT::tsbpd(void* param)
tsNextDelivery = steady_clock::time_point(); // Ready to read, nothing to wait for.
}

// We may just briefly unlocked the m_RecvLock, so we need to check m_bClosing again to avoid deadlock.
if (self->m_bClosing)
break;

if (!is_zero(tsNextDelivery))
{
IF_HEAVY_LOGGING(const steady_clock::duration timediff = tsNextDelivery - tnow);
Expand Down

0 comments on commit 7cfe12b

Please sign in to comment.