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 45ed354b0f85f4bf2033d07bac1dc279cca618e7..f183eeb5f3ea8da9667068c718a1780171498202 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;
                }