Re: [spice v10 10/27] server: Make the RedDrawable refcount thread-safe

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

 



On Wed, Mar 23, 2016 at 07:09:14AM -0400, Frediano Ziglio wrote:
> > For what it's worth, the only thing which is needed is the GMainContext,
> > not the full-fledged RedWorker. It seems going from RedWorker to
> > QXLInstance is easy, but I did not see an obvious way of getting a
> > RedWorker from a QXLInstance.
> > I'm going to sound like a broken record, but adding
> > 
> > @@ -1551,14 +1568,34 @@ SPICE_GNUC_NORETURN static void *red_worker_main(void
> > *arg)
> >      RED_CHANNEL(worker->cursor_channel)->thread_id = pthread_self();
> >      RED_CHANNEL(worker->display_channel)->thread_id = pthread_self();
> > 
> > +    g_main_context_push_thread_default(worker->core.main_context);
> >      GMainLoop *loop = g_main_loop_new(worker->core.main_context, FALSE);
> >      g_main_loop_run(loop);
> >      g_main_loop_unref(loop);
> > +    g_main_context_pop_thread_default(worker->core.main_context);
> > 
> >      /* FIXME: free worker, and join threads */
> >      exit(0);
> >  }
> > 
> > and using g_main_context_get_thread_default() at the right time (ie when we
> > are
> > in the display thread, not in one of the GStreamer threads) would do the
> > trick as well.
> > 
> 
> yes, but g_main_context_push_thread_default works if you are using the same
> thread but if GStreamer spawn their own thread you still have to get the
> context from there.

The spice-side encoding code runs from the display thread, so you would
have to get the GMainContext from this code, not from the code running
in a GStreamer thread, this is what I meant with by "(ie ...)".

Christophe

Attachment: signature.asc
Description: PGP signature

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel

[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]