GOutputStream: Use async read/write of streams in splice_async()
authorMike Ruprecht <mike.ruprecht@collabora.co.uk>
Mon, 18 Feb 2013 14:12:50 +0000 (08:12 -0600)
committerDan Winship <danw@gnome.org>
Sun, 29 Sep 2013 21:48:41 +0000 (17:48 -0400)
commit4e9e7d0cba53a711bd650e9a5e28452b93f0d849
tree70fa1fc68dc089dbd121874c3ee398c9a37c06f7
parent87e5617a65883c49eab9291db4a644a520362ed0
GOutputStream: Use async read/write of streams in splice_async()

There are some corner cases where using the sync version of read/write
in a thread could cause thread-safety issues. In these cases it's
possible to override the output stream's splice_async() function,
but for input streams one would need to do some acrobatics to
stay thread-safe. Alternatively, some implementations may not even
override their sync read/write functions.

This patch refactors the default splice_async() implementation to
call the sync read and write functions in a thread only when both
async versions are thread-based. When one or both are non-threaded,
it calls the virtual write_async() and read_async() functions of the
involved streams within the same thread.

https://bugzilla.gnome.org/show_bug.cgi?id=691581
gio/goutputstream.c