Internals: Rename. No functional change.

This commit is contained in:
Wilson Snyder 2023-11-11 20:47:10 -05:00
parent 9d7f5bdc26
commit 4a10c9ef6f
2 changed files with 4 additions and 4 deletions

View File

@ -3246,11 +3246,11 @@ void VlDeleter::deleteAll() VL_EXCLUDES(m_mutex) VL_EXCLUDES(m_deleteMutex) VL_M
VerilatedLockGuard lock{m_mutex};
if (m_newGarbage.empty()) break;
m_deleteMutex.lock();
std::swap(m_newGarbage, m_toDelete);
std::swap(m_newGarbage, m_deleteNow);
// m_mutex is unlocked here, so destructors can enqueue new objects
}
for (VlDeletable* const objp : m_toDelete) delete objp;
m_toDelete.clear();
for (VlDeletable* const objp : m_deleteNow) delete objp;
m_deleteNow.clear();
m_deleteMutex.unlock();
}
}

View File

@ -1499,7 +1499,7 @@ class VlDeleter final {
// Queue of new objects that should be deleted
std::vector<VlDeletable*> m_newGarbage VL_GUARDED_BY(m_mutex);
// Queue of objects currently being deleted (only for deleteAll())
std::vector<VlDeletable*> m_toDelete VL_GUARDED_BY(m_deleteMutex);
std::vector<VlDeletable*> m_deleteNow VL_GUARDED_BY(m_deleteMutex);
mutable VerilatedMutex m_mutex; // Mutex protecting the 'new garbage' queue
mutable VerilatedMutex m_deleteMutex; // Mutex protecting the delete queue