Re: [PATCH v2 09/13] vireventthread: exit thread synchronously on finalize

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On 7/23/20 7:14 AM, Nikolay Shirokovskiy wrote:
It useful to be sure no thread is running after we drop all references to

Nit: "It is useful to ..."


Reviewed-by: Daniel Henrique Barboza <danielhb413@xxxxxxxxx>

virEventThread. Otherwise in order to avoid crashes we need to synchronize some
other way or we make extra references in event handler callbacks to all the
object in use. And some of them are not prepared to be refcounted.

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@xxxxxxxxxxxxx>
---
  src/util/vireventthread.c | 1 +
  1 file changed, 1 insertion(+)

diff --git a/src/util/vireventthread.c b/src/util/vireventthread.c
index cf86592..136a550 100644
--- a/src/util/vireventthread.c
+++ b/src/util/vireventthread.c
@@ -43,6 +43,7 @@ vir_event_thread_finalize(GObject *object)
if (evt->thread) {
          g_main_loop_quit(evt->loop);
+        g_thread_join(evt->thread);
          g_thread_unref(evt->thread);
      }




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux