qemu-devel
[Top][All Lists]
Advanced

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

[PATCH 2/2] If we have more than one colo-compare, we can only destroy t


From: quweijie
Subject: [PATCH 2/2] If we have more than one colo-compare, we can only destroy the lock when we delete the last one.
Date: Mon, 11 May 2020 18:00:31 +0800

From: quweijie <address@hidden>

Signed-off-by: quweijie <address@hidden>
---
 net/colo-compare.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/net/colo-compare.c b/net/colo-compare.c
index 10c0239..ee878f6 100644
--- a/net/colo-compare.c
+++ b/net/colo-compare.c
@@ -1313,8 +1313,10 @@ static void colo_compare_finalize(Object *obj)
         object_unref(OBJECT(s->iothread));
     }
 
-    qemu_mutex_destroy(&event_mtx);
-    qemu_cond_destroy(&event_complete_cond);
+    if(QTAILQ_EMPTY(&net_compares)) {
+        qemu_mutex_destroy(&event_mtx);
+        qemu_cond_destroy(&event_complete_cond);
+    }
 
     g_free(s->pri_indev);
     g_free(s->sec_indev);
-- 
1.8.3.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]