[Spice-devel] [PATCH v3 8/9] Handle GL_DRAW messages

Marc-André Lureau marcandre.lureau at gmail.com
Tue Feb 9 13:21:33 UTC 2016


Hi

On Thu, Feb 4, 2016 at 4:25 PM, Frediano Ziglio <fziglio at redhat.com> wrote:
> Here you can have a race condition.
> If red_dispatcher_async_complete wake up the Qemu thread before reset
> gl_draw_async it could be possible Qemu will try to send another draw
> finding gl_draw_async not NULL and returning without doing nothing
> Just save on an automatic variable, set to NULL and call complete
> function

I suppose that's what you mean:

     if (num == 0) {
-        red_dispatcher_async_complete(qxl->st->dispatcher,
qxl->st->gl_draw_async);
+        struct AsyncCommand *async = qxl->st->gl_draw_async;
         qxl->st->gl_draw_async = NULL;
+        red_dispatcher_async_complete(qxl->st->dispatcher, async);
     }


-- 
Marc-André Lureau


More information about the Spice-devel mailing list