From c3b69e59fc4e165bdabea130905e9b9525dfaeba Mon Sep 17 00:00:00 2001 From: Zhao Lei Date: Mon, 27 Jul 2015 20:24:27 +0800 Subject: btrfs-progs: Move close timer handle code to line after sub process exit The timer handle have possibility in using by sub thread, better to close it after sub process exit. Signed-off-by: Zhao Lei Signed-off-by: David Sterba --- task-utils.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'task-utils.c') diff --git a/task-utils.c b/task-utils.c index 0390a69f..17fd5736 100644 --- a/task-utils.c +++ b/task-utils.c @@ -61,14 +61,14 @@ void task_stop(struct task_info *info) if (!info) return; - if (info->periodic.timer_fd) - close(info->periodic.timer_fd); - if (info->id > 0) { pthread_cancel(info->id); pthread_join(info->id, NULL); } + if (info->periodic.timer_fd) + close(info->periodic.timer_fd); + if (info->postfn) info->postfn(info->private_data); } -- cgit v1.2.3