Internals: Lock the same mutex reference as specified in VL_ACQUIRE. (#4194)

This commit is contained in:
Mariusz Glebocki 2023-05-13 16:28:34 +02:00 committed by GitHub
parent e7714e0902
commit be429a5800
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -218,7 +218,7 @@ public:
/// Construct and hold given mutex lock until destruction or unlock()
explicit VerilatedLockGuard(VerilatedMutex& mutexr) VL_ACQUIRE(mutexr) VL_MT_SAFE
: m_mutexr(mutexr) { // Need () or GCC 4.8 false warning
m_mutexr.lock();
mutexr.lock();
}
/// Destruct and unlock the mutex
~VerilatedLockGuard() VL_RELEASE() { m_mutexr.unlock(); }

View File

@ -137,7 +137,7 @@ public:
/// Construct and hold given mutex lock until destruction or unlock()
explicit V3LockGuardImp(T& mutexr) VL_ACQUIRE(mutexr) VL_MT_SAFE
: m_mutexr(mutexr) { // Need () or GCC 4.8 false warning
m_mutexr.lock();
mutexr.lock();
}
/// Destruct and unlock the mutex
~V3LockGuardImp() VL_RELEASE() { m_mutexr.unlock(); }