Allow threads 60 seconds to exit before being forceful
[fio.git] / libfio.c
index 8af11297e17c5eed31bd3e23df72ed40c1bfab25..9245688a029b7771c300df0c923ce680f426e04b 100644 (file)
--- a/libfio.c
+++ b/libfio.c
@@ -199,8 +199,13 @@ void fio_terminate_threads(int group_id)
                if (group_id == TERMINATE_ALL || groupid == td->groupid) {
                        dprint(FD_PROCESS, "setting terminate on %s/%d\n",
                                                td->o.name, (int) td->pid);
+
+                       if (td->terminate)
+                               continue;
+
                        td->terminate = 1;
                        td->o.start_delay = 0;
+                       fio_gettime(&td->terminate_time, NULL);
 
                        /*
                         * if the thread is running, just let it exit