From: Jens Axboe Date: Mon, 23 Jul 2007 12:36:16 +0000 (+0200) Subject: Add ->done variable to force exit when we know we are done X-Git-Tag: fio-1.17~57 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=20e354ef1243541ea196619772b83a962d7cb4df;hp=7172cfe8e0e918cc279eb501986f6ec78cc7aad9 Add ->done variable to force exit when we know we are done Signed-off-by: Jens Axboe --- diff --git a/fio.c b/fio.c index 16e19c8f..bc837c44 100644 --- a/fio.c +++ b/fio.c @@ -724,6 +724,8 @@ static int keep_running(struct thread_data *td) { unsigned long long io_done; + if (td->done) + return 0; if (td->o.time_based) return 1; if (td->o.loops) { diff --git a/fio.h b/fio.h index b7d8582e..ace4b164 100644 --- a/fio.h +++ b/fio.h @@ -472,6 +472,7 @@ struct thread_data { os_random_state_t next_file_state; }; int error; + int done; pid_t pid; char *orig_buffer; size_t orig_buffer_size; diff --git a/log.c b/log.c index cc90f437..7a3327e5 100644 --- a/log.c +++ b/log.c @@ -91,6 +91,7 @@ int read_iolog_get(struct thread_data *td, struct io_u *io_u) return 0; } + td->done = 1; return 1; }