signal condition variable at end of stop_tracers
authorRobert Schiele <rschiele@gmail.com>
Mon, 8 Sep 2014 07:38:52 +0000 (09:38 +0200)
committerJens Axboe <axboe@fb.com>
Mon, 8 Sep 2014 14:15:58 +0000 (08:15 -0600)
stop_tracers modifies tp->is_done and thus must signal the condition
variable tracer_wait_unblock is waiting on to monitor tp->is_done.
Not doing so might cause the tool to deadlock if stop_tracers is
called while a tracer thread is in tracer_wait_unblock.

Signed-off-by: Robert Schiele <rschiele@gmail.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
blktrace.c

index 7e64c94194374d8f5b15427f9c80428260890aa6..3c8fb4c43885c48b2c73d113ce282df5bb007ce4 100644 (file)
@@ -1913,6 +1913,7 @@ static void stop_tracers(void)
                struct tracer *tp = list_entry(p, struct tracer, head);
                tp->is_done = 1;
        }
+       pthread_cond_broadcast(&mt_cond);
 }
 
 static void del_tracers(void)