mirror of
https://github.com/amadvance/snapraid.git
synced 2026-10-26 19:01:57 -04:00
Move task ring list mutation under io_mutex for code hygiene, no bug
Some checks failed
Some checks failed
This commit is contained in:
parent
952ea337e7
commit
c8cb392a89
1 changed files with 4 additions and 4 deletions
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue