From c8cb392a89564b986fd07128562ab8b75717799c Mon Sep 17 00:00:00 2001 From: Andrea Mazzoleni Date: Mon, 6 Jul 2026 16:30:03 +0200 Subject: [PATCH] Move task ring list mutation under io_mutex for code hygiene, no bug --- cmdline/io.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cmdline/io.c b/cmdline/io.c index 6c7a7c6e..370629e9 100644 --- a/cmdline/io.c +++ b/cmdline/io.c @@ -605,12 +605,12 @@ static struct snapraid_task* io_task_read_thread(struct snapraid_io* io, unsigne task = &worker->task_map[io->reader_index]; - thread_mutex_unlock(&io->io_mutex); - /* mark the worker as processed */ /* setting the previous one to point at the next one */ *let = io->reader_list[i + 1]; + thread_mutex_unlock(&io->io_mutex); + /* return the position */ *pos = i - base; @@ -691,12 +691,12 @@ static void io_parity_write_thread(struct snapraid_io* io, unsigned* pos, unsign /* if the worker has finished this index */ if (busy_index != worker->index) { - thread_mutex_unlock(&io->io_mutex); - /* mark the worker as processed */ /* setting the previous one to point at the next one */ *let = io->writer_list[i + 1]; + thread_mutex_unlock(&io->io_mutex); + /* return the position */ *pos = i;