diff --git a/cmdline/io.c b/cmdline/io.c index a5e92d93..6c7a7c6e 100644 --- a/cmdline/io.c +++ b/cmdline/io.c @@ -751,7 +751,12 @@ static void* io_reader_thread(void* arg) if (task->state == TASK_STATE_EMPTY) continue; - assert(task->state == TASK_STATE_READY); + if (task->state != TASK_STATE_READY) { + /* LCOV_EXCL_START */ + log_fatal(EINTERNAL, "Internal inconsistency: Unexpected state %d in reader for task at position %u in worker %u\n", task->state, task->position, worker->index); + os_abort(); + /* LCOV_EXCL_STOP */ + } /* work on the assigned task */ io_reader_worker(worker, task); @@ -781,7 +786,12 @@ static void* io_writer_thread(void* arg) continue; } - assert(task->state == TASK_STATE_READY); + if (task->state != TASK_STATE_READY) { + /* LCOV_EXCL_START */ + log_fatal(EINTERNAL, "Internal inconsistency: Unexpected state %d in writer for task at position %u in worker %u\n", task->state, task->position, worker->index); + os_abort(); + /* LCOV_EXCL_STOP */ + } /* work on the assigned task */ worker->func(worker, task);