Message ID | 11cd6dd1c443035bd449a2a721f96f2d5f2dff93.1437977968.git.zhaolei@cn.fujitsu.com (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
diff --git a/task-utils.c b/task-utils.c index 0390a69..17fd573 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); }