X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=backend.c;h=90d998dc18653630d7a6d6979085901166a7f52d;hp=4437d196c0d5cdf2b5a9ce34c1982d353e7ea480;hb=fda2cfacd5ebe1212fade95e6286f7e7ec8919f9;hpb=b2ee7647ee05604397672f6b7c1a804b07466270 diff --git a/backend.c b/backend.c index 4437d196..90d998dc 100644 --- a/backend.c +++ b/backend.c @@ -1564,13 +1564,17 @@ err: if (o->write_iolog_file) write_iolog_close(td); - fio_mutex_remove(td->rusage_sem); - td->rusage_sem = NULL; - fio_mutex_remove(td->mutex); td->mutex = NULL; td_set_runstate(td, TD_EXITED); + + /* + * Do this last after setting our runstate to exited, so we + * know that the stat thread is signaled. + */ + check_update_rusage(td); + return (void *) (uintptr_t) td->error; } @@ -2097,8 +2101,11 @@ int fio_backend(void) } } - for_each_td(td, i) + for_each_td(td, i) { fio_options_free(td); + fio_mutex_remove(td->rusage_sem); + td->rusage_sem = NULL; + } free_disk_util(); cgroup_kill(cgroup_list);