Move task ring list mutation under io_mutex for code hygiene, no bug
Some checks failed
Build / build-mac (push) Has been cancelled
Build / build-linux (push) Has been cancelled
Build / build-win (push) Has been cancelled
CodeQL Advanced / Analyze (c-cpp) (push) Has been cancelled
CodeQL Advanced / Analyze (actions) (push) Has been cancelled

This commit is contained in:
Andrea Mazzoleni 2026-07-06 16:30:03 +02:00
parent 952ea337e7
commit c8cb392a89

View file

@ -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;