Internals: Make mutex classes uncopyable. (#4223)

This commit is contained in:
Mariusz Glebocki 2023-05-25 13:35:14 +02:00 committed by GitHub
parent 0ece155418
commit 8303938d0e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 0 deletions

View File

@ -175,6 +175,7 @@ public:
/// Construct mutex (without locking it)
VerilatedMutex() = default;
~VerilatedMutex() = default;
VL_UNCOPYABLE(VerilatedMutex);
const VerilatedMutex& operator!() const { return *this; } // For -fthread_safety
/// Acquire/lock mutex
void lock() VL_ACQUIRE() VL_MT_SAFE {

View File

@ -85,6 +85,7 @@ public:
/// Construct mutex (without locking it)
V3MutexImp() = default;
~V3MutexImp() = default;
VL_UNCOPYABLE(V3MutexImp);
const V3MutexImp& operator!() const { return *this; } // For -fthread_safety
/// Acquire/lock mutex
void lock() VL_ACQUIRE() VL_MT_SAFE {