From 711d3791a3539f2506a7c8d66e6c6ba3e509d070 Mon Sep 17 00:00:00 2001 From: Mariusz Glebocki Date: Tue, 7 Nov 2023 18:23:05 +0100 Subject: [PATCH] Add VL_UNCOVERABLE --- src/V3ThreadPool.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/V3ThreadPool.h b/src/V3ThreadPool.h index 47df04650f..031f3b02d7 100644 --- a/src/V3ThreadPool.h +++ b/src/V3ThreadPool.h @@ -125,11 +125,11 @@ class V3ThreadPool final { // wrong. This won't make things worse to an user - the program is already terminating at // this point anyway, most likely as a result of an error. Using if/abort instead of assert // because assert can be disabled. - if (m_exclusiveAccess) std::abort(); - if (m_stopRequested) std::abort(); + if (VL_UNCOVERABLE(m_exclusiveAccess)) std::abort(); + if (VL_UNCOVERABLE(m_stopRequested)) std::abort(); - if (!m_mutex.try_lock()) { - if (m_jobsInProgress != 0) { + if (VL_UNCOVERABLE(!m_mutex.try_lock())) { + if (VL_UNCOVERABLE(m_jobsInProgress != 0)) { // ThreadPool shouldn't be destroyed when jobs are running and mutex is locked, // something is wrong. Most likely Verilator is exitting as a result of failed // assert in critical section. Just returning is dangerous, as threads and this