GDBusConnection: delegate to the worker to close the stream

We can't safely close the output part of the I/O stream until any
pending write or flush has been completed. In the worst case, this could
lead to an assertion failure in the worker (when the close wins the
race) or not closing the stream at all (when the write wins the race).

Bug: https://bugzilla.gnome.org/show_bug.cgi?id=651268
Bug-NB: NB#271520
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Signed-off-by: David Zeuthen <davidz@redhat.com>
This commit is contained in:
Simon McVittie
2011-09-13 17:31:27 +01:00
committed by David Zeuthen
parent a8f75f21b4
commit 8097e2de85
3 changed files with 240 additions and 76 deletions

View File

@@ -76,6 +76,11 @@ gboolean _g_dbus_worker_flush_sync (GDBusWorker *worker,
GCancellable *cancellable,
GError **error);
/* can be called from any thread */
void _g_dbus_worker_close (GDBusWorker *worker,
GCancellable *cancellable,
GSimpleAsyncResult *result);
/* ---------------------------------------------------------------------------------------------------- */
void _g_dbus_initialize (void);