From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51558) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gTqED-0007yE-89 for qemu-devel@nongnu.org; Mon, 03 Dec 2018 10:33:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gTqE8-00041X-EX for qemu-devel@nongnu.org; Mon, 03 Dec 2018 10:33:45 -0500 Received: from mx1.redhat.com ([209.132.183.28]:33130) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gTqE8-00040k-8w for qemu-devel@nongnu.org; Mon, 03 Dec 2018 10:33:40 -0500 From: Paolo Bonzini Date: Mon, 3 Dec 2018 16:32:19 +0100 Message-Id: <1543851204-41186-7-git-send-email-pbonzini@redhat.com> In-Reply-To: <1543851204-41186-1-git-send-email-pbonzini@redhat.com> References: <1543851204-41186-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH 06/71] vhost-user-test: use g_cond_broadcast List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Emanuele Giuseppe Esposito , Laurent Vivier , Thomas Huth g_cond_signal is rarely the right thing to do, it works now because vhost-user-test only has two threads but it is not correct in general. Fix it before adding more calls. Reviewed-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Paolo Bonzini --- tests/vhost-user-test.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/vhost-user-test.c b/tests/vhost-user-test.c index 45d58d8..656e519 100644 --- a/tests/vhost-user-test.c +++ b/tests/vhost-user-test.c @@ -393,7 +393,7 @@ static void chr_read(void *opaque, const uint8_t *buf= , int size) G_N_ELEMENTS(s->fds)); =20 /* signal the test that it can continue */ - g_cond_signal(&s->data_cond); + g_cond_broadcast(&s->data_cond); break; =20 case VHOST_USER_SET_VRING_KICK: @@ -419,7 +419,7 @@ static void chr_read(void *opaque, const uint8_t *buf= , int size) p =3D (uint8_t *) &msg; qemu_chr_fe_write_all(chr, p, VHOST_USER_HDR_SIZE); =20 - g_cond_signal(&s->data_cond); + g_cond_broadcast(&s->data_cond); break; =20 case VHOST_USER_SET_VRING_BASE: --=20 1.8.3.1