aboutsummaryrefslogtreecommitdiff
path: root/tests/vhost-user-test.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2018-12-03 16:32:19 +0100
committerPaolo Bonzini <pbonzini@redhat.com>2019-02-05 16:48:40 +0100
commit04ad1bf68e22dd5de8249ffd4c4e5886d50f3f95 (patch)
treea534002d6ade69a912bb3c4f18421b56bd2ba870 /tests/vhost-user-test.c
parent1c3d45df5e94042d5fb2bb31416072563ab30e49 (diff)
vhost-user-test: use g_cond_broadcast
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é Lureau <marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Message-Id: <1543851204-41186-7-git-send-email-pbonzini@redhat.com>
Diffstat (limited to 'tests/vhost-user-test.c')
-rw-r--r--tests/vhost-user-test.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/vhost-user-test.c b/tests/vhost-user-test.c
index 84e50d84e7..9baaff4f24 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));
/* signal the test that it can continue */
- g_cond_signal(&s->data_cond);
+ g_cond_broadcast(&s->data_cond);
break;
case VHOST_USER_SET_VRING_KICK:
@@ -419,7 +419,7 @@ static void chr_read(void *opaque, const uint8_t *buf, int size)
p = (uint8_t *) &msg;
qemu_chr_fe_write_all(chr, p, VHOST_USER_HDR_SIZE);
- g_cond_signal(&s->data_cond);
+ g_cond_broadcast(&s->data_cond);
break;
case VHOST_USER_SET_VRING_BASE: