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

[core] Fixed THREAD_STATE_INIT usage in CRcvQueue. #3001

Merged

Conversation

maxsharabayko
Copy link
Collaborator

The CRcvQueue::m_counter variable is shared between threads. The THREAD_STATE_INIT macro used the value to form the thread name, but the value could be the same for several threads.
The thread must already have a name set via ThreadName. Therefore just extract it via ThreadName::get(std::string&).

Fixes #2973.

@maxsharabayko maxsharabayko added Type: Bug Indicates an unexpected problem or unintended behavior [core] Area: Changes in SRT library core labels Aug 8, 2024
@maxsharabayko maxsharabayko added this to the v1.5.4 milestone Aug 8, 2024
Copy link
Collaborator

@jeandube jeandube left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the distinction between LOGGING/!not LOGGING required, since it is handled in ::init already?
Shouldn't the same fix be applied to the SndQ as well?

@maxsharabayko
Copy link
Collaborator Author

Is the distinction between LOGGING/!not LOGGING required, since it is handled in ::init already? Shouldn't the same fix be applied to the SndQ as well?

You are right. Fixed in the second commit.

@maxsharabayko maxsharabayko merged commit 91f2c59 into Haivision:master Aug 8, 2024
12 checks passed
@maxsharabayko maxsharabayko deleted the hotfix/thread-state-init branch August 8, 2024 14:57
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 Type: Bug Indicates an unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Make Thread Counter Thread Safe
3 participants