aboutsummaryrefslogtreecommitdiff
path: root/io/channel-socket.c
diff options
context:
space:
mode:
authorPeter Xu <peterx@redhat.com>2018-03-05 14:43:22 +0800
committerDaniel P. Berrangé <berrange@redhat.com>2018-03-06 10:19:05 +0000
commita17536c594bfed94d05667b419f747b692f5fc7f (patch)
tree6e623ad270bb97e1eae6685e32d80e110b55247a /io/channel-socket.c
parent938c8b79e5249d41469151e30268cfaf88bdb588 (diff)
qio: non-default context for threaded qtask
qio_task_run_in_thread() allows main thread to run blocking operations in the background. However it has an assumption on that it's always working with the default context. This patch tries to allow the threaded QIO task framework to run with non-default gcontext. Currently no functional change so far, so the QIOTasks are still always running on main context. Reviewed-by: Daniel P. Berrange <berrange@redhat.com> Signed-off-by: Peter Xu <peterx@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Diffstat (limited to 'io/channel-socket.c')
-rw-r--r--io/channel-socket.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/io/channel-socket.c b/io/channel-socket.c
index 8359b6683a..b4d914b767 100644
--- a/io/channel-socket.c
+++ b/io/channel-socket.c
@@ -188,7 +188,8 @@ void qio_channel_socket_connect_async(QIOChannelSocket *ioc,
qio_task_run_in_thread(task,
qio_channel_socket_connect_worker,
addrCopy,
- (GDestroyNotify)qapi_free_SocketAddress);
+ (GDestroyNotify)qapi_free_SocketAddress,
+ NULL);
}
@@ -246,7 +247,8 @@ void qio_channel_socket_listen_async(QIOChannelSocket *ioc,
qio_task_run_in_thread(task,
qio_channel_socket_listen_worker,
addrCopy,
- (GDestroyNotify)qapi_free_SocketAddress);
+ (GDestroyNotify)qapi_free_SocketAddress,
+ NULL);
}
@@ -322,7 +324,8 @@ void qio_channel_socket_dgram_async(QIOChannelSocket *ioc,
qio_task_run_in_thread(task,
qio_channel_socket_dgram_worker,
data,
- qio_channel_socket_dgram_worker_free);
+ qio_channel_socket_dgram_worker_free,
+ NULL);
}