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

Failure to acquire mutex lock #236

Open
Voltra opened this issue Sep 8, 2023 · 1 comment
Open

Failure to acquire mutex lock #236

Voltra opened this issue Sep 8, 2023 · 1 comment

Comments

@Voltra
Copy link

Voltra commented Sep 8, 2023

std::unique_lock<std::mutex>(job_mutex);

std::unique_lock<std::mutex>(job_mutex);

std::unique_lock<std::mutex>(job_mutex);

The lines of code above actually default initialize a local std::unique_lock<std::mutex> named job_mutex instead of creating a lock on the job_mutex member.

You should look for occurences of std::unique_lock<std::mutex>( in the codebase for similar bugs.

@Voltra
Copy link
Author

Voltra commented Sep 8, 2023

See this CppCon 2017 talk for reference: https://youtu.be/lkgszkPnV8g?si=NSm2AemA2FiRso8k&t=1946

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant