Send wakeups only when a command is available. This emulate better what a guest driver should do (append the command to the ring and then signal). Signed-off-by: Frediano Ziglio <fziglio@xxxxxxxxxx> --- server/tests/replay.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/server/tests/replay.c b/server/tests/replay.c index 0c98168..517b8fd 100644 --- a/server/tests/replay.c +++ b/server/tests/replay.c @@ -26,6 +26,7 @@ #include <string.h> #include <stdlib.h> #include <stdio.h> +#include <stdbool.h> #include <sys/types.h> #include <signal.h> #include <unistd.h> @@ -108,6 +109,7 @@ static void get_init_info(QXLInstance *qin, QXLDevInitInfo *info) static gboolean fill_queue_idle(gpointer user_data) { gboolean keep = FALSE; + bool wakeup = false; while (g_async_queue_length(aqueue) < 50) { QXLCommandExt *cmd = spice_replay_next_cmd(replay, qxl_worker); @@ -119,6 +121,7 @@ static gboolean fill_queue_idle(gpointer user_data) if (slow) g_usleep(slow); + wakeup = true; g_async_queue_push(aqueue, cmd); } @@ -132,7 +135,8 @@ end: } pthread_mutex_unlock(&mutex); } - spice_qxl_wakeup(&display_sin); + if (wakeup) + spice_qxl_wakeup(&display_sin); return keep; } -- 2.4.3 _______________________________________________ Spice-devel mailing list Spice-devel@xxxxxxxxxxxxxxxxxxxxx http://lists.freedesktop.org/mailman/listinfo/spice-devel