Skip to content

Commit

Permalink
Add VL_UNCOVERABLE
Browse files Browse the repository at this point in the history
  • Loading branch information
Mariusz Glebocki committed Nov 7, 2023
1 parent 6b81b6c commit 711d379
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/V3ThreadPool.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 711d379

Please sign in to comment.