Don't kill() running threads
authorJens Axboe <jens.axboe@oracle.com>
Mon, 5 Mar 2007 19:18:31 +0000 (20:18 +0100)
committerJens Axboe <jens.axboe@oracle.com>
Mon, 5 Mar 2007 19:18:31 +0000 (20:18 +0100)
Just let them exit nicely.

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
fio.c

diff --git a/fio.c b/fio.c
index 45ed354..f183eeb 100644 (file)
--- a/fio.c
+++ b/fio.c
@@ -67,7 +67,11 @@ static void terminate_threads(int group_id)
 
        for_each_td(td, i) {
                if (group_id == TERMINATE_ALL || groupid == td->groupid) {
-                       kill(td->pid, SIGQUIT);
+                       /*
+                        * if the thread is running, just let it exit
+                        */
+                       if (td->runstate < TD_RUNNING)
+                               kill(td->pid, SIGQUIT);
                        td->terminate = 1;
                        td->start_delay = 0;
                }