[PATCH spice-streaming-agent v4 0/5] Add a SpiceStream class for stream access

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

 



From: Christophe de Dinechin <dinechin@xxxxxxxxxx>

Add a SpiceStream that owns the actual stream.
This has several benefits:

1. It makes it possible to use proper RAII to deal
   with the lifetime of the stream file descriptor

2. It opens the door for dealing with multiple streams

3. It removes one global with associated race conditions

A pre-existing race conditions when creating the thread
that processes cursor data is eliminated as a side effect.

Changes in v2:

* Extended the role of SpiceStream struct to encapsulate streamfd
* Fixed a pre-existing race condition when starting cursor thread

Changes in v3:

* Change SpiceStream to a class
* A couple of int->bool adjustments
* Made write_all private and use streamfd
* Remove test for streamfd<0 in dtor

Changes in v4:

* Fixed indentation

Christophe de Dinechin (5):
  style: Remove useless whitespace
  style: Use C++ style for declaring structs
  Switch 'blocking' flag to bool
  Use RAII to cleanup stream in case of exception or return
  Move all stream-related functions within SpiceStream class

 src/spice-streaming-agent.cpp | 112 +++++++++++++++++++++++++-----------------
 1 file changed, 66 insertions(+), 46 deletions(-)

-- 
2.13.5 (Apple Git-94)

_______________________________________________
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]