From 4d5891e23dd71632c729b6d7975d5082d532a642 Mon Sep 17 00:00:00 2001 From: Matthieu Herrb Date: Mon, 13 Nov 2023 10:56:41 +0100 Subject: [PATCH] Cancel the monitor thread on the exit path. avoids a lock-up in pthread_join() for this thread. --- udev-monitor.c | 1 + 1 file changed, 1 insertion(+) diff --git a/udev-monitor.c b/udev-monitor.c index b97c5a5..1dad1a2 100644 --- a/udev-monitor.c +++ b/udev-monitor.c @@ -334,6 +334,7 @@ udev_monitor_unref(struct udev_monitor *um) TRC("(%p) refcount=%d", um, um->refcount); if (--um->refcount == 0) { close(um->fds[0]); + pthread_cancel(um->thread); pthread_join(um->thread, NULL); close(um->fds[1]); udev_filter_free(&um->filters);