gfio: clear progress bar on job end
authorJens Axboe <axboe@kernel.dk>
Tue, 6 Mar 2012 19:47:15 +0000 (20:47 +0100)
committerJens Axboe <axboe@kernel.dk>
Tue, 6 Mar 2012 19:47:15 +0000 (20:47 +0100)
And detach fio server thread.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
gfio.c

diff --git a/gfio.c b/gfio.c
index 4c9cce15892beb9ade81677d2ffee4bad958c3e5..9c26fececdafafdbcfeda2a63e29fedf62acee09 100644 (file)
--- a/gfio.c
+++ b/gfio.c
@@ -1227,6 +1227,7 @@ static void gfio_start_server(struct gui *ui)
        if (!gfio_server_running) {
                gfio_server_running = 1;
                pthread_create(&ui->server_t, NULL, server_thread, NULL);
        if (!gfio_server_running) {
                gfio_server_running = 1;
                pthread_create(&ui->server_t, NULL, server_thread, NULL);
+               pthread_detach(ui->server_t);
        }
 }
 
        }
 }
 
@@ -1249,6 +1250,7 @@ static void connect_clicked(GtkWidget *widget, gpointer data)
                if (!ui->nr_job_files)
                        file_open(widget, data);
                gtk_progress_bar_set_text(GTK_PROGRESS_BAR(ui->thread_status_pb), "No jobs running");
                if (!ui->nr_job_files)
                        file_open(widget, data);
                gtk_progress_bar_set_text(GTK_PROGRESS_BAR(ui->thread_status_pb), "No jobs running");
+               gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(ui->thread_status_pb), 0.0);
                if (!fio_clients_connect()) {
                        pthread_create(&ui->t, NULL, job_thread, NULL);
                        gtk_widget_set_sensitive(ui->button[CONNECT_BUTTON], 0);
                if (!fio_clients_connect()) {
                        pthread_create(&ui->t, NULL, job_thread, NULL);
                        gtk_widget_set_sensitive(ui->button[CONNECT_BUTTON], 0);