File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed
Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -9992,12 +9992,13 @@ bool srt::CUDT::overrideSndSeqNo(int32_t seq)
99929992int srt::CUDT::checkLazySpawnTsbPdThread ()
99939993{
99949994 const bool need_tsbpd = m_bTsbPd || m_bGroupTsbPd;
9995+ if (!need_tsbpd)
9996+ return 0 ;
99959997
9996- if (need_tsbpd && !m_RcvTsbPdThread.joinable ())
9998+ ScopedLock lock (m_RcvTsbPdStartupLock);
9999+ if (!m_RcvTsbPdThread.joinable ())
999710000 {
9998- ScopedLock lock (m_RcvTsbPdStartupLock);
9999-
10000- if (m_bClosing) // Check again to protect join() in CUDT::releaseSync()
10001+ if (m_bClosing) // Check m_bClosing to protect join() in CUDT::releaseSync().
1000110002 return -1 ;
1000210003
1000310004 HLOGP (qrlog.Debug , " Spawning Socket TSBPD thread" );
Original file line number Diff line number Diff line change @@ -995,7 +995,7 @@ class CUDT
995995 sync::CThread m_RcvTsbPdThread; // Rcv TsbPD Thread handle
996996 sync::Condition m_RcvTsbPdCond; // TSBPD signals if reading is ready. Use together with m_RecvLock
997997 bool m_bTsbPdNeedsWakeup; // Signal TsbPd thread to wake up on RCV buffer state change.
998- sync::Mutex m_RcvTsbPdStartupLock; // Protects TSBPD thread creating and joining
998+ sync::Mutex m_RcvTsbPdStartupLock; // Protects TSBPD thread creation and joining.
999999
10001000 CallbackHolder<srt_listen_callback_fn> m_cbAcceptHook;
10011001 CallbackHolder<srt_connect_callback_fn> m_cbConnectHook;
You can’t perform that action at this time.
0 commit comments