Don't use 'assert' in profiler initialization

This commit is contained in:
Geza Lore 2022-07-05 12:17:04 +01:00
parent 2873dbe154
commit 42b711b862

View File

@ -108,10 +108,13 @@ void VlExecutionProfiler::setupThread(uint32_t threadId) {
// while profiling.
t_trace.reserve(RESERVED_TRACE_CAPACITY);
// Register thread-local buffer in list of all buffers
bool exists;
{
const VerilatedLockGuard lock{m_mutex};
bool exists = !m_traceps.emplace(threadId, &t_trace).second;
assert(!exists);
exists = !m_traceps.emplace(threadId, &t_trace).second;
}
if (VL_UNLIKELY(exists)) {
VL_FATAL_MT(__FILE__, __LINE__, "", "multiple initialization of profiler on some thread");
}
}