Protect rate limiter state updates with a mutex to prevent data races

This commit is contained in:
Andrea Mazzoleni 2026-08-12 00:22:27 +02:00
parent b4a694bb10
commit eebb3943e5
4 changed files with 34 additions and 1 deletions

View file

@ -1138,6 +1138,8 @@ void io_done(struct snapraid_io* io)
free(io->writer_map);
free(io->writer_list);
bw_done(&io->bw);
#if HAVE_THREAD
if (io->io_max > 1) {
thread_mutex_destroy(&io->io_mutex);