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

2016-06-30 Thread Hans de Goede
Hi, On 30-06-16 09:13, Christophe Fergeau wrote: On Wed, Jun 29, 2016 at 07:20:16PM +0200, Hans de Goede wrote: Hi, On 29-06-16 17:42, Christophe Fergeau wrote: This variable is accessed from 2 different threads (main thread and USB event thread), so some care must be taken to read/write it.

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

2016-06-30 Thread Christophe Fergeau
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

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

2016-06-30 Thread Christophe Fergeau
On Wed, Jun 29, 2016 at 07:20:16PM +0200, Hans de Goede wrote: > Hi, > > On 29-06-16 17:42, Christophe Fergeau wrote: > > This variable is accessed from 2 different threads (main thread and USB > > event thread), so some care must be taken to read/write it. > > The event-thread only reads it, so

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

2016-06-29 Thread Hans de Goede
Hi, On 29-06-16 17:42, Christophe Fergeau wrote: This variable is accessed from 2 different threads (main thread and USB event thread), so some care must be taken to read/write it. The event-thread only reads it, so I believe there is no need for this. Regards, Hans ---

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

2016-06-29 Thread Marc-André Lureau
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. > src/usb-device-manager.c | 6 +++--- >

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

2016-06-29 Thread Christophe Fergeau
This variable is accessed from 2 different threads (main thread and USB event thread), so some care must be taken to read/write it. --- src/usb-device-manager.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/usb-device-manager.c b/src/usb-device-manager.c index