[Spice-devel] [spice-gtk 2/3] usbredir: Use atomic for UsbDeviceManager::event_thread_run

Christophe Fergeau cfergeau at redhat.com
Thu Jun 30 08:25:51 UTC 2016


On Wed, Jun 29, 2016 at 12:07:48PM -0400, Marc-André Lureau wrote:
> Hi
> 
> ----- Original Message -----
> > This variable is accessed from 2 different threads (main thread and USB
> > event thread), so some care must be taken to read/write it.
> > ---
> 
> event_thread_run is a bool, you should make it a gint, probably even volatile.

I've changed it to gint in v2, I don't know about the volatile, are
there cases where not having it as a volatile is going to cause issues?
Code using GAtomic in glib does not seem to be using volatile.

Christophe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20160630/daa185c7/attachment-0001.sig>


More information about the Spice-devel mailing list