mirror of
https://github.com/amadvance/snapraid.git
synced 2026-10-26 19:01:57 -04:00
Log more information in assertion failure
This commit is contained in:
parent
4d7277a68e
commit
c837a9ace0
1 changed files with 12 additions and 2 deletions
14
cmdline/io.c
14
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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue