From be429a58000e4e75a0f47d170706cbd70879a790 Mon Sep 17 00:00:00 2001 From: Mariusz Glebocki Date: Sat, 13 May 2023 16:28:34 +0200 Subject: [PATCH] Internals: Lock the same mutex reference as specified in VL_ACQUIRE. (#4194) --- include/verilated.h | 2 +- src/V3Mutex.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/verilated.h b/include/verilated.h index ac2d3c773..190488d04 100644 --- a/include/verilated.h +++ b/include/verilated.h @@ -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(); } diff --git a/src/V3Mutex.h b/src/V3Mutex.h index b1ee4b021..ffa1bdd07 100644 --- a/src/V3Mutex.h +++ b/src/V3Mutex.h @@ -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(); }