VstdLib: change mutex type for CGaussianRandomStream

Needs to be CThreadMutex.
This commit is contained in:
Kawe Mazidjatari 2024-07-30 11:50:06 +02:00
parent 0a49d03589
commit 31eac6bcc4
2 changed files with 3 additions and 3 deletions

View File

@ -186,7 +186,7 @@ CGaussianRandomStream::CGaussianRandomStream(IUniformRandomStream* pUniformStrea
//-----------------------------------------------------------------------------
void CGaussianRandomStream::AttachToStream(IUniformRandomStream* pUniformStream)
{
std::lock_guard<std::mutex> l(m_mutex);
AUTO_LOCK( m_mutex );
m_pUniformStream = pUniformStream;
m_bHaveValue = false;
@ -198,7 +198,7 @@ void CGaussianRandomStream::AttachToStream(IUniformRandomStream* pUniformStream)
//-----------------------------------------------------------------------------
float CGaussianRandomStream::RandomFloat(float flMean, float flStdDev)
{
std::lock_guard<std::mutex> l(m_mutex);
AUTO_LOCK( m_mutex );
IUniformRandomStream* pUniformStream = m_pUniformStream ? m_pUniformStream : s_pUniformStream;
float fac, rsq, v1, v2;

View File

@ -85,7 +85,7 @@ private:
bool m_bHaveValue;
float m_flRandomValue;
std::mutex m_mutex;
CThreadMutex m_mutex;
};