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

This commit is contained in:
Mariusz Glebocki
2023-05-13 10:28:34 -04:00
committed by GitHub
parent e7714e0902
commit be429a5800
2 changed files with 2 additions and 2 deletions
+1 -1
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(); }
+1 -1
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(); }