Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed race starting and joining TSBPD thread #1629

Merged
merged 2 commits into from
Oct 29, 2020

Conversation

maxsharabayko
Copy link
Collaborator

@maxsharabayko maxsharabayko commented Oct 27, 2020

This is a rework of #1620. Fixes #1624.
Closes #1606. Closes #1620.

  1. CUDT::m_RecvDataLock is removed, as it was wrongfully used together with CUDT::m_RecvDataCond in some places. CUDT::m_RecvDataCond is assumed to be used with CUDT::m_RecvLock.

  2. Added CUDT::m_RcvTsbPdStartupLock to prevent a race in creating and joining the TSBPD thread from different threads.
    Reusing any of the existing mutexes complicates the code, unfortunately.

@maxsharabayko maxsharabayko added Type: Bug Indicates an unexpected problem or unintended behavior [core] Area: Changes in SRT library core labels Oct 27, 2020
@maxsharabayko maxsharabayko added this to the v1.4.3 milestone Oct 27, 2020
m_RecvDataCond must be used with m_RecvLock instead of m_RecvDataLock.
m_RecvDataLock is only used to sync releaseSynch() calls.
@maxsharabayko
Copy link
Collaborator Author

Changes are split into two commits to simplify finding the faulty change in case of some issues.

@maxsharabayko maxsharabayko merged commit a6f6663 into Haivision:master Oct 29, 2020
@maxsharabayko maxsharabayko deleted the hotfix/recv-data-lock branch October 29, 2020 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[core] Area: Changes in SRT library core Priority: High Type: Bug Indicates an unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Potential leak of TSBPD thread
2 participants