From 0cbbd0a53c19ffe73fd54e14e61722e1f32f8820 Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Tue, 12 Feb 2019 18:17:09 +0100 Subject: [PATCH] path: cancel paths threads --- lib/path.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/path.c b/lib/path.c index c1ffee1cd..e3e4c0829 100644 --- a/lib/path.c +++ b/lib/path.c @@ -828,6 +828,11 @@ int path_stop(struct path *p) if (p->state != STATE_STOPPING) p->state = STATE_STOPPING; + /* Cancel the thread in case is currently in a blocking syscall */ + ret = pthread_cancel(p->tid); + if (ret) + return ret; + ret = pthread_join(p->tid, NULL); if (ret) return ret;