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

MersenneTwisterGlobals replace std::recursive_mutex with std::mutex, rename data member from "Lock" to "Mutex" #4333

Conversation

N-Dekker
Copy link
Contributor

@N-Dekker N-Dekker commented Nov 17, 2023

Replaced std::recursive_mutex with the more lightweight std::mutex as type of MersenneTwisterGlobals::m_StaticInstanceLock. This mutex is only used by MersenneTwisterRandomVariateGenerator::GetInstance(). This member function does not call itself, so the mutex does not need to be "recursive".

Renamed MersenneTwisterGlobals::m_StaticInstanceLock to MersenneTwisterGlobals::m_StaticInstanceLock

Replaced `std::recursive_mutex` with the more lightweight `std::mutex` as type
of `MersenneTwisterGlobals::m_StaticInstanceLock`. This mutex is only used
`MersenneTwisterRandomVariateGenerator::GetInstance()`. This member function
does not call itself, so the mutex does not need to be "recursive".
Following pull request InsightSoftwareConsortium#4217
commit 0150e46
STYLE: Rename private and internal data members from "Lock" to "Mutex"
@github-actions github-actions bot added the area:Core Issues affecting the Core module label Nov 17, 2023
@N-Dekker N-Dekker marked this pull request as ready for review November 20, 2023 20:09
@dzenanz dzenanz merged commit 476d9e7 into InsightSoftwareConsortium:master Nov 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:Core Issues affecting the Core module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants