Commit 3613b7a3 authored by Philip Withnall's avatar Philip Withnall

gio: Add source tags to various GTasks constructed in GLib

This makes them easier to identify when debugging and profiling.

This patch was somewhat less than interesting to write.

https://bugzilla.gnome.org/show_bug.cgi?id=767765
parent 7ea4949c
......@@ -272,6 +272,7 @@ g_async_initable_real_init_async (GAsyncInitable *initable,
g_return_if_fail (G_IS_INITABLE (initable));
task = g_task_new (initable, cancellable, callback, user_data);
g_task_set_source_tag (task, g_async_initable_real_init_async);
g_task_set_priority (task, io_priority);
g_task_run_in_thread (task, async_init_thread);
g_object_unref (task);
......
......@@ -1079,6 +1079,7 @@ g_buffered_input_stream_real_fill_async (GBufferedInputStream *stream,
compact_buffer (stream);
task = g_task_new (stream, cancellable, callback, user_data);
g_task_set_source_tag (task, g_buffered_input_stream_real_fill_async);
base_stream = G_FILTER_INPUT_STREAM (stream)->base_stream;
g_input_stream_read_async (base_stream,
......@@ -1212,6 +1213,7 @@ g_buffered_input_stream_skip_async (GInputStream *stream,
data = g_slice_new (SkipAsyncData);
data->bytes_skipped = 0;
task = g_task_new (stream, cancellable, callback, user_data);
g_task_set_source_tag (task, g_buffered_input_stream_skip_async);
g_task_set_task_data (task, data, free_skip_async_data);
available = priv->end - priv->pos;
......
......@@ -704,6 +704,7 @@ g_buffered_output_stream_flush_async (GOutputStream *stream,
fdata->close_stream = FALSE;
task = g_task_new (stream, cancellable, callback, data);
g_task_set_source_tag (task, g_buffered_output_stream_flush_async);
g_task_set_task_data (task, fdata, free_flush_data);
g_task_set_priority (task, io_priority);
......@@ -735,6 +736,7 @@ g_buffered_output_stream_close_async (GOutputStream *stream,
fdata->close_stream = TRUE;
task = g_task_new (stream, cancellable, callback, data);
g_task_set_source_tag (task, g_buffered_output_stream_close_async);
g_task_set_task_data (task, fdata, free_flush_data);
g_task_set_priority (task, io_priority);
......
......@@ -238,6 +238,7 @@ g_bytes_icon_load_async (GLoadableIcon *icon,
GTask *task;
task = g_task_new (icon, cancellable, callback, user_data);
g_task_set_source_tag (task, g_bytes_icon_load_async);
g_task_return_pointer (task, g_memory_input_stream_new_from_bytes (bytes_icon->bytes), g_object_unref);
g_object_unref (task);
}
......
......@@ -1085,6 +1085,7 @@ g_data_input_stream_read_async (GDataInputStream *stream,
data->last_saw_cr = FALSE;
task = g_task_new (stream, cancellable, callback, user_data);
g_task_set_source_tag (task, g_data_input_stream_read_async);
g_task_set_task_data (task, data, g_data_input_stream_read_data_free);
g_task_set_priority (task, io_priority);
......
......@@ -865,6 +865,7 @@ g_dbus_address_get_stream (const gchar *address,
data->address = g_strdup (address);
task = g_task_new (NULL, cancellable, callback, user_data);
g_task_set_source_tag (task, g_dbus_address_get_stream);
g_task_set_task_data (task, data, (GDestroyNotify) get_stream_data_free);
g_task_run_in_thread (task, get_stream_thread_func);
g_object_unref (task);
......
......@@ -1250,6 +1250,7 @@ g_dbus_connection_flush (GDBusConnection *connection,
g_return_if_fail (G_IS_DBUS_CONNECTION (connection));
task = g_task_new (connection, cancellable, callback, user_data);
g_task_set_source_tag (task, g_dbus_connection_flush);
g_task_run_in_thread (task, flush_in_thread_func);
g_object_unref (task);
}
......@@ -1446,6 +1447,7 @@ g_dbus_connection_close (GDBusConnection *connection,
g_assert (connection->worker != NULL);
task = g_task_new (connection, cancellable, callback, user_data);
g_task_set_source_tag (task, g_dbus_connection_close);
_g_dbus_worker_close (connection->worker, task);
g_object_unref (task);
}
......@@ -1904,6 +1906,8 @@ g_dbus_connection_send_message_with_reply_unlocked (GDBusConnection *connect
data = g_slice_new0 (SendMessageData);
task = g_task_new (connection, cancellable, callback, user_data);
g_task_set_source_tag (task,
g_dbus_connection_send_message_with_reply_unlocked);
g_task_set_task_data (task, data, (GDestroyNotify) send_message_data_free);
if (g_task_return_error_if_cancelled (task))
......@@ -5772,6 +5776,7 @@ g_dbus_connection_call_internal (GDBusConnection *connection,
state->reply_type = g_variant_type_copy (reply_type);
task = g_task_new (connection, cancellable, callback, user_data);
g_task_set_source_tag (task, g_dbus_connection_call_internal);
g_task_set_task_data (task, state, (GDestroyNotify) call_state_free);
g_dbus_connection_send_message_with_reply (connection,
......@@ -7312,6 +7317,7 @@ g_bus_get (GBusType bus_type,
GError *error = NULL;
task = g_task_new (NULL, cancellable, callback, user_data);
g_task_set_source_tag (task, g_bus_get);
connection = get_uninitialized_connection (bus_type, cancellable, &error);
if (connection == NULL)
......
......@@ -627,6 +627,7 @@ g_dbus_interface_method_dispatch_helper (GDBusInterfaceSkeleton *interface
data->ref_count = 1;
task = g_task_new (interface, NULL, NULL, NULL);
g_task_set_source_tag (task, g_dbus_interface_method_dispatch_helper);
g_task_set_task_data (task, data, (GDestroyNotify) dispatch_data_unref);
g_task_run_in_thread (task, dispatch_in_thread_func);
g_object_unref (task);
......
......@@ -173,6 +173,7 @@ _g_socket_read_with_control_messages (GSocket *socket,
data->num_messages = num_messages;
task = g_task_new (socket, cancellable, callback, user_data);
g_task_set_source_tag (task, _g_socket_read_with_control_messages);
g_task_set_task_data (task, data, (GDestroyNotify) read_with_control_data_free);
if (g_socket_condition_check (socket, G_IO_IN))
......@@ -1091,6 +1092,7 @@ write_message_async (GDBusWorker *worker,
gpointer user_data)
{
data->task = g_task_new (NULL, NULL, callback, user_data);
g_task_set_source_tag (data->task, write_message_async);
data->total_written = 0;
write_message_continue_writing (data);
}
......
......@@ -1679,6 +1679,7 @@ async_initable_init_second_async (GAsyncInitable *initable,
GTask *task;
task = g_task_new (proxy, cancellable, callback, user_data);
g_task_set_source_tag (task, async_initable_init_second_async);
g_task_set_priority (task, io_priority);
/* Check name ownership asynchronously - possibly also start the service */
......@@ -1848,6 +1849,7 @@ async_initable_init_async (GAsyncInitable *initable,
GTask *task;
task = g_task_new (proxy, cancellable, callback, user_data);
g_task_set_source_tag (task, async_initable_init_async);
g_task_set_priority (task, io_priority);
if (proxy->priv->bus_type != G_BUS_TYPE_NONE)
......@@ -2674,6 +2676,7 @@ g_dbus_proxy_call_internal (GDBusProxy *proxy,
{
my_callback = (GAsyncReadyCallback) reply_cb;
task = g_task_new (proxy, cancellable, callback, user_data);
g_task_set_source_tag (task, g_dbus_proxy_call_internal);
}
else
{
......
......@@ -95,6 +95,7 @@ g_dummy_proxy_resolver_lookup_async (GProxyResolver *resolver,
gchar **proxies;
task = g_task_new (resolver, cancellable, callback, user_data);
g_task_set_source_tag (task, g_dummy_proxy_resolver_lookup_async);
proxies = g_dummy_proxy_resolver_lookup (resolver, uri, cancellable, &error);
if (proxies)
......
......@@ -5420,6 +5420,7 @@ g_file_real_query_info_async (GFile *file,
data->flags = flags;
task = g_task_new (file, cancellable, callback, user_data);
g_task_set_source_tag (task, g_file_real_query_info_async);
g_task_set_task_data (task, data, (GDestroyNotify)query_info_data_free);
g_task_set_priority (task, io_priority);
g_task_run_in_thread (task, query_info_async_thread);
......@@ -5464,6 +5465,7 @@ g_file_real_query_filesystem_info_async (GFile *file,
GTask *task;
task = g_task_new (file, cancellable, callback, user_data);
g_task_set_source_tag (task, g_file_real_query_filesystem_info_async);
g_task_set_task_data (task, g_strdup (attributes), g_free);
g_task_set_priority (task, io_priority);
g_task_run_in_thread (task, query_filesystem_info_async_thread);
......@@ -5514,6 +5516,7 @@ g_file_real_enumerate_children_async (GFile *file,
data->flags = flags;
task = g_task_new (file, cancellable, callback, user_data);
g_task_set_source_tag (task, g_file_real_enumerate_children_async);
g_task_set_task_data (task, data, (GDestroyNotify)query_info_data_free);
g_task_set_priority (task, io_priority);
g_task_run_in_thread (task, enumerate_children_async_thread);
......@@ -5556,6 +5559,7 @@ g_file_real_read_async (GFile *file,
GTask *task;
task = g_task_new (file, cancellable, callback, user_data);
g_task_set_source_tag (task, g_file_real_read_async);
g_task_set_priority (task, io_priority);
g_task_run_in_thread (task, open_read_async_thread);
g_object_unref (task);
......@@ -5603,6 +5607,7 @@ g_file_real_append_to_async (GFile *file,
*data = flags;
task = g_task_new (file, cancellable, callback, user_data);
g_task_set_source_tag (task, g_file_real_append_to_async);
g_task_set_task_data (task, data, g_free);
g_task_set_priority (task, io_priority);
......@@ -5652,6 +5657,7 @@ g_file_real_create_async (GFile *file,
*data = flags;
task = g_task_new (file, cancellable, callback, user_data);
g_task_set_source_tag (task, g_file_real_create_async);
g_task_set_task_data (task, data, g_free);
g_task_set_priority (task, io_priority);
......@@ -5727,6 +5733,7 @@ g_file_real_replace_async (GFile *file,
data->flags = flags;
task = g_task_new (file, cancellable, callback, user_data);
g_task_set_source_tag (task, g_file_real_replace_async);
g_task_set_task_data (task, data, (GDestroyNotify)replace_async_data_free);
g_task_set_priority (task, io_priority);
......@@ -5768,6 +5775,7 @@ g_file_real_delete_async (GFile *file,
GTask *task;
task = g_task_new (file, cancellable, callback, user_data);
g_task_set_source_tag (task, g_file_real_delete_async);
g_task_set_priority (task, io_priority);
g_task_run_in_thread (task, delete_async_thread);
g_object_unref (task);
......@@ -5807,6 +5815,7 @@ g_file_real_trash_async (GFile *file,
GTask *task;
task = g_task_new (file, cancellable, callback, user_data);
g_task_set_source_tag (task, g_file_real_trash_async);
g_task_set_priority (task, io_priority);
g_task_run_in_thread (task, trash_async_thread);
g_object_unref (task);
......@@ -5846,6 +5855,7 @@ g_file_real_make_directory_async (GFile *file,
GTask *task;
task = g_task_new (file, cancellable, callback, user_data);
g_task_set_source_tag (task, g_file_real_make_directory_async);
g_task_set_priority (task, io_priority);
g_task_run_in_thread (task, make_directory_async_thread);
g_object_unref (task);
......@@ -5888,6 +5898,7 @@ g_file_real_open_readwrite_async (GFile *file,
GTask *task;
task = g_task_new (file, cancellable, callback, user_data);
g_task_set_source_tag (task, g_file_real_open_readwrite_async);
g_task_set_priority (task, io_priority);
g_task_run_in_thread (task, open_readwrite_async_thread);
......@@ -5937,6 +5948,7 @@ g_file_real_create_readwrite_async (GFile *file,
*data = flags;
task = g_task_new (file, cancellable, callback, user_data);
g_task_set_source_tag (task, g_file_real_create_readwrite_async);
g_task_set_task_data (task, data, g_free);
g_task_set_priority (task, io_priority);
......@@ -6009,6 +6021,7 @@ g_file_real_replace_readwrite_async (GFile *file,
data->flags = flags;
task = g_task_new (file, cancellable, callback, user_data);
g_task_set_source_tag (task, g_file_real_replace_readwrite_async);
g_task_set_task_data (task, data, (GDestroyNotify)replace_rw_async_data_free);
g_task_set_priority (task, io_priority);
......@@ -6055,6 +6068,7 @@ g_file_real_set_display_name_async (GFile *file,
GTask *task;
task = g_task_new (file, cancellable, callback, user_data);
g_task_set_source_tag (task, g_file_real_set_display_name_async);
g_task_set_task_data (task, g_strdup (display_name), g_free);
g_task_set_priority (task, io_priority);
......@@ -6122,6 +6136,7 @@ g_file_real_set_attributes_async (GFile *file,
data->flags = flags;
task = g_task_new (file, cancellable, callback, user_data);
g_task_set_source_tag (task, g_file_real_set_attributes_async);
g_task_set_task_data (task, data, (GDestroyNotify)set_info_data_free);
g_task_set_priority (task, io_priority);
......@@ -6177,6 +6192,7 @@ g_file_real_find_enclosing_mount_async (GFile *file,
GTask *task;
task = g_task_new (file, cancellable, callback, user_data);
g_task_set_source_tag (task, g_file_real_find_enclosing_mount_async);
g_task_set_priority (task, io_priority);
g_task_run_in_thread (task, find_enclosing_mount_async_thread);
......@@ -6295,6 +6311,7 @@ g_file_real_copy_async (GFile *source,
data->progress_cb_data = progress_callback_data;
task = g_task_new (source, cancellable, callback, user_data);
g_task_set_source_tag (task, g_file_real_copy_async);
g_task_set_task_data (task, data, (GDestroyNotify)copy_async_data_free);
g_task_set_priority (task, io_priority);
g_task_run_in_thread (task, copy_async_thread);
......@@ -6975,6 +6992,7 @@ g_file_load_partial_contents_async (GFile *file,
data->content = g_byte_array_new ();
data->task = g_task_new (file, cancellable, callback, user_data);
g_task_set_source_tag (data->task, g_file_load_partial_contents_async);
g_task_set_task_data (data->task, data, (GDestroyNotify)load_contents_data_free);
g_file_read_async (file,
......@@ -7418,6 +7436,7 @@ g_file_replace_contents_bytes_async (GFile *file,
data->content = g_bytes_ref (contents);
data->task = g_task_new (file, cancellable, callback, user_data);
g_task_set_source_tag (data->task, g_file_replace_contents_bytes_async);
g_task_set_task_data (data->task, data, (GDestroyNotify)replace_contents_data_free);
g_file_replace_async (file,
......@@ -7589,6 +7608,7 @@ g_file_real_measure_disk_usage_async (GFile *file,
data.progress_data = progress_data;
task = g_task_new (file, cancellable, callback, user_data);
g_task_set_source_tag (task, g_file_real_measure_disk_usage_async);
g_task_set_task_data (task, g_memdup (&data, sizeof data), g_free);
g_task_set_priority (task, io_priority);
......
......@@ -803,6 +803,7 @@ g_file_enumerator_real_next_files_async (GFileEnumerator *enumerator,
GTask *task;
task = g_task_new (enumerator, cancellable, callback, user_data);
g_task_set_source_tag (task, g_file_enumerator_real_next_files_async);
g_task_set_task_data (task, GINT_TO_POINTER (num_files), NULL);
g_task_set_priority (task, io_priority);
......@@ -849,6 +850,7 @@ g_file_enumerator_real_close_async (GFileEnumerator *enumerator,
GTask *task;
task = g_task_new (enumerator, cancellable, callback, user_data);
g_task_set_source_tag (task, g_file_enumerator_real_close_async);
g_task_set_priority (task, io_priority);
g_task_run_in_thread (task, close_async_thread);
......
......@@ -322,6 +322,7 @@ g_file_icon_load_async (GLoadableIcon *icon,
GTask *task;
task = g_task_new (icon, cancellable, callback, user_data);
g_task_set_source_tag (task, g_file_icon_load_async);
g_file_read_async (file_icon->file, 0,
cancellable,
......
......@@ -410,6 +410,7 @@ g_file_input_stream_real_query_info_async (GFileInputStream *stream,
GTask *task;
task = g_task_new (stream, cancellable, callback, user_data);
g_task_set_source_tag (task, g_file_input_stream_real_query_info_async);
g_task_set_task_data (task, g_strdup (attributes), g_free);
g_task_set_priority (task, io_priority);
......
......@@ -513,6 +513,7 @@ g_file_output_stream_real_query_info_async (GFileOutputStream *stream,
GTask *task;
task = g_task_new (stream, cancellable, callback, user_data);
g_task_set_source_tag (task, g_file_output_stream_real_query_info_async);
g_task_set_task_data (task, g_strdup (attributes), g_free);
g_task_set_priority (task, io_priority);
......
......@@ -327,6 +327,7 @@ g_http_proxy_connect_async (GProxy *proxy,
data->proxy_address = g_object_ref (proxy_address);
task = g_task_new (proxy, cancellable, callback, user_data);
g_task_set_source_tag (task, g_http_proxy_connect_async);
g_task_set_task_data (task, data, (GDestroyNotify) free_connect_data);
g_task_run_in_thread (task, connect_thread);
......
......@@ -783,6 +783,7 @@ g_input_stream_read_all_async (GInputStream *stream,
data->buffer = buffer;
data->to_read = count;
g_task_set_source_tag (task, g_input_stream_read_all_async);
g_task_set_task_data (task, data, free_async_read_all);
g_task_set_priority (task, io_priority);
......@@ -919,6 +920,8 @@ g_input_stream_read_bytes_async (GInputStream *stream,
guchar *buf;
task = g_task_new (stream, cancellable, callback, user_data);
g_task_set_source_tag (task, g_input_stream_read_bytes_async);
buf = g_malloc (count);
g_task_set_task_data (task, buf, NULL);
......@@ -1378,6 +1381,7 @@ g_input_stream_real_read_async (GInputStream *stream,
op = g_slice_new0 (ReadData);
task = g_task_new (stream, cancellable, callback, user_data);
g_task_set_source_tag (task, g_input_stream_real_read_async);
g_task_set_task_data (task, op, (GDestroyNotify) free_read_data);
g_task_set_priority (task, io_priority);
op->buffer = buffer;
......@@ -1489,6 +1493,7 @@ g_input_stream_real_skip_async (GInputStream *stream,
class = G_INPUT_STREAM_GET_CLASS (stream);
task = g_task_new (stream, cancellable, callback, user_data);
g_task_set_source_tag (task, g_input_stream_real_skip_async);
g_task_set_priority (task, io_priority);
if (g_input_stream_async_read_is_via_threads (stream))
......@@ -1564,6 +1569,7 @@ g_input_stream_real_close_async (GInputStream *stream,
GTask *task;
task = g_task_new (stream, cancellable, callback, user_data);
g_task_set_source_tag (task, g_input_stream_real_close_async);
g_task_set_check_cancellable (task, FALSE);
g_task_set_priority (task, io_priority);
......
......@@ -138,6 +138,9 @@ g_io_scheduler_push_job (GIOSchedulerJobFunc job_func,
G_UNLOCK (active_jobs);
task = g_task_new (NULL, cancellable, NULL, NULL);
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
g_task_set_source_tag (task, g_io_scheduler_push_job);
G_GNUC_END_IGNORE_DEPRECATIONS
g_task_set_task_data (task, job, (GDestroyNotify)g_io_job_free);
g_task_set_priority (task, io_priority);
g_task_run_in_thread (task, io_job_thread);
......
......@@ -492,6 +492,7 @@ g_io_stream_close_async (GIOStream *stream,
g_return_if_fail (G_IS_IO_STREAM (stream));
task = g_task_new (stream, cancellable, callback, user_data);
g_task_set_source_tag (task, g_io_stream_close_async);
if (stream->priv->closed)
{
......@@ -624,6 +625,7 @@ g_io_stream_real_close_async (GIOStream *stream,
GTask *task;
task = g_task_new (stream, cancellable, callback, user_data);
g_task_set_source_tag (task, g_io_stream_real_close_async);
g_task_set_check_cancellable (task, FALSE);
g_task_set_priority (task, io_priority);
......@@ -870,6 +872,7 @@ g_io_stream_splice_async (GIOStream *stream1,
ctx->completed = 0;
task = g_task_new (NULL, cancellable, callback, user_data);
g_task_set_source_tag (task, g_io_stream_splice_async);
g_task_set_task_data (task, ctx, (GDestroyNotify) splice_context_free);
if (cancellable != NULL)
......
......@@ -200,6 +200,7 @@ g_loadable_icon_real_load_async (GLoadableIcon *icon,
LoadData *data;
task = g_task_new (icon, cancellable, callback, user_data);
g_task_set_source_tag (task, g_loadable_icon_real_load_async);
data = g_new0 (LoadData, 1);
g_task_set_task_data (task, data, (GDestroyNotify) load_data_free);
g_task_run_in_thread (task, load_async_thread);
......
......@@ -379,6 +379,8 @@ g_memory_input_stream_skip_async (GInputStream *stream,
nskipped = G_INPUT_STREAM_GET_CLASS (stream)->skip (stream, count, cancellable, &error);
task = g_task_new (stream, cancellable, callback, user_data);
g_task_set_source_tag (task, g_memory_input_stream_skip_async);
if (error)
g_task_return_error (task, error);
else
......@@ -406,6 +408,7 @@ g_memory_input_stream_close_async (GInputStream *stream,
GTask *task;
task = g_task_new (stream, cancellable, callback, user_data);
g_task_set_source_tag (task, g_memory_input_stream_close_async);
g_task_return_boolean (task, TRUE);
g_object_unref (task);
}
......
......@@ -693,6 +693,7 @@ g_memory_output_stream_close_async (GOutputStream *stream,
GTask *task;
task = g_task_new (stream, cancellable, callback, data);
g_task_set_source_tag (task, g_memory_output_stream_close_async);
/* will always return TRUE */
g_memory_output_stream_close (stream, cancellable, NULL);
......
......@@ -1006,6 +1006,7 @@ g_network_address_address_enumerator_next_async (GSocketAddressEnumerator *enum
GTask *task;
task = g_task_new (addr_enum, cancellable, callback, user_data);
g_task_set_source_tag (task, g_network_address_address_enumerator_next_async);
if (addr_enum->addresses == NULL)
{
......
......@@ -224,6 +224,8 @@ g_network_monitor_real_can_reach_async (GNetworkMonitor *monitor,
GError *error = NULL;
task = g_task_new (monitor, cancellable, callback, user_data);
g_task_set_source_tag (task, g_network_monitor_real_can_reach_async);
if (g_network_monitor_can_reach (monitor, connectable, cancellable, &error))
g_task_return_boolean (task, TRUE);
else
......
......@@ -302,6 +302,7 @@ g_network_monitor_base_can_reach_async (GNetworkMonitor *monitor,
GSocketAddressEnumerator *enumerator;
task = g_task_new (monitor, cancellable, callback, user_data);
g_task_set_source_tag (task, g_network_monitor_base_can_reach_async);
if (G_NETWORK_MONITOR_BASE (monitor)->priv->networks->len == 0)
{
......
......@@ -545,6 +545,7 @@ g_network_service_address_enumerator_next_async (GSocketAddressEnumerator *enum
GTask *task;
task = g_task_new (enumerator, cancellable, callback, user_data);
g_task_set_source_tag (task, g_network_service_address_enumerator_next_async);
/* If we haven't yet resolved srv, do that */
if (!srv_enum->srv->priv->targets)
......
......@@ -998,6 +998,7 @@ g_output_stream_write_all_async (GOutputStream *stream,
data->buffer = buffer;
data->to_write = count;
g_task_set_source_tag (task, g_output_stream_write_all_async);
g_task_set_task_data (task, data, free_async_write_all);
g_task_set_priority (task, io_priority);
......@@ -1115,6 +1116,7 @@ g_output_stream_write_bytes_async (GOutputStream *stream,
data = g_bytes_get_data (bytes, &size);
task = g_task_new (stream, cancellable, callback, user_data);
g_task_set_source_tag (task, g_output_stream_write_bytes_async);
g_task_set_task_data (task, g_bytes_ref (bytes),
(GDestroyNotify) g_bytes_unref);
......
......@@ -527,6 +527,7 @@ g_proxy_address_enumerator_next_async (GSocketAddressEnumerator *enumerator,
GTask *task;
task = g_task_new (enumerator, cancellable, callback, user_data);
g_task_set_source_tag (task, g_proxy_address_enumerator_next_async);
g_task_set_task_data (task, priv, NULL);
if (priv->proxies == NULL)
......
......@@ -377,6 +377,7 @@ g_simple_proxy_resolver_lookup_async (GProxyResolver *proxy_resolver,
char **proxies;
task = g_task_new (resolver, cancellable, callback, user_data);
g_task_set_source_tag (task, g_simple_proxy_resolver_lookup_async);
proxies = g_simple_proxy_resolver_lookup (proxy_resolver, uri,
cancellable, &error);
......
......@@ -98,6 +98,7 @@ g_socket_address_enumerator_real_next_async (GSocketAddressEnumerator *enumerato
GError *error = NULL;
task = g_task_new (enumerator, NULL, callback, user_data);
g_task_set_source_tag (task, g_socket_address_enumerator_real_next_async);
address = g_socket_address_enumerator_next (enumerator, cancellable, &error);
if (error)
......
......@@ -1679,6 +1679,7 @@ g_socket_client_connect_async (GSocketClient *client,
data->enumerator = g_socket_connectable_enumerate (connectable);
data->task = g_task_new (client, cancellable, callback, user_data);
g_task_set_source_tag (data->task, g_socket_client_connect_async);
g_task_set_task_data (data->task, data, (GDestroyNotify)g_socket_client_async_connect_data_free);
enumerator_next_async (data);
......
......@@ -196,6 +196,7 @@ g_socket_connection_connect_async (GSocketConnection *connection,
g_return_if_fail (G_IS_SOCKET_ADDRESS (address));
task = g_task_new (connection, cancellable, callback, user_data);
g_task_set_source_tag (task, g_socket_connection_connect_async);
g_socket_set_blocking (connection->priv->socket, FALSE);
......@@ -501,6 +502,7 @@ g_socket_connection_close_async (GIOStream *stream,
class = G_IO_STREAM_GET_CLASS (stream);
task = g_task_new (stream, cancellable, callback, user_data);
g_task_set_source_tag (task, g_socket_connection_close_async);
/* socket close is not blocked, just do it! */
error = NULL;
......
......@@ -813,6 +813,7 @@ g_socket_listener_accept_socket_async (GSocketListener *listener,
GError *error = NULL;
task = g_task_new (listener, cancellable, callback, user_data);
g_task_set_source_tag (task, g_socket_listener_accept_socket_async);
if (!check_listener (listener, &error))
{
......
......@@ -316,6 +316,7 @@ g_socks4a_proxy_connect_async (GProxy *proxy,
data->io_stream = g_object_ref (io_stream);
task = g_task_new (proxy, cancellable, callback, user_data);
g_task_set_source_tag (task, g_socks4a_proxy_connect_async);
g_task_set_task_data (task, data, (GDestroyNotify) free_connect_data);
hostname = g_proxy_address_get_destination_hostname (proxy_address);
......
......@@ -626,6 +626,7 @@ g_socks5_proxy_connect_async (GProxy *proxy,
data->io_stream = g_object_ref (io_stream);
task = g_task_new (proxy, cancellable, callback, user_data);
g_task_set_source_tag (task, g_socks5_proxy_connect_async);
g_task_set_task_data (task, data, (GDestroyNotify) free_connect_data);
g_object_get (G_OBJECT (proxy_address),
......
......@@ -849,6 +849,7 @@ g_subprocess_wait_async (GSubprocess *subprocess,
GTask *task;
task = g_task_new (subprocess, cancellable, callback, user_data);
g_task_set_source_tag (task, g_subprocess_wait_async);
g_mutex_lock (&subprocess->pending_waits_lock);
if (subprocess->pid)
......@@ -1518,6 +1519,8 @@ g_subprocess_communicate_internal (GSubprocess *subprocess,
GTask *task;
task = g_task_new (subprocess, cancellable, callback, user_data);
g_task_set_source_tag (task, g_subprocess_communicate_internal);
state = g_slice_new0 (CommunicateState);
g_task_set_task_data (task, state, g_subprocess_communicate_state_free);
......
......@@ -261,6 +261,7 @@ g_tcp_connection_close_async (GIOStream *stream,
!g_cancellable_is_cancelled (cancellable) /* Cancelled -> close fast */)
{
task = g_task_new (stream, cancellable, callback, user_data);
g_task_set_source_tag (task, g_tcp_connection_close_async);
g_task_set_priority (task, io_priority);
socket = g_socket_connection_get_socket (G_SOCKET_CONNECTION (stream));
......
......@@ -141,6 +141,7 @@ lookup_by_name (GResolver *resolver,
GList *addresses;
task = g_task_new (resolver, cancellable, NULL, NULL);
g_task_set_source_tag (task, lookup_by_name);
g_task_set_task_data (task, g_strdup (hostname), g_free);
g_task_set_return_on_cancel (task, TRUE);
g_task_run_in_thread_sync (task, do_lookup_by_name);
......@@ -160,6 +161,7 @@ lookup_by_name_async (GResolver *resolver,
GTask *task;
task = g_task_new (resolver, cancellable, callback, user_data);
g_task_set_source_tag (task, lookup_by_name_async);
g_task_set_task_data (task, g_strdup (hostname), g_free);
g_task_set_return_on_cancel (task, TRUE);
g_task_run_in_thread (task, do_lookup_by_name);
......@@ -225,6 +227,7 @@ lookup_by_address (GResolver *resolver,
gchar *name;
task = g_task_new (resolver, cancellable, NULL, NULL);
g_task_set_source_tag (task, lookup_by_address);
g_task_set_task_data (task, g_object_ref (address), g_object_unref);
g_task_set_return_on_cancel (task, TRUE);
g_task_run_in_thread_sync (task, do_lookup_by_address);
......@@ -244,6 +247,7 @@ lookup_by_address_async (GResolver *resolver,
GTask *task;
task = g_task_new (resolver, cancellable, callback, user_data);
g_task_set_source_tag (task, lookup_by_address_async);
g_task_set_task_data (task, g_object_ref (address), g_object_unref);
g_task_set_return_on_cancel (task, TRUE);
g_task_run_in_thread (task, do_lookup_by_address);
......@@ -875,6 +879,7 @@ lookup_records (GResolver *resolver,
LookupRecordsData *lrd;
task = g_task_new (resolver, cancellable, NULL, NULL);
g_task_set_source_tag (task, lookup_records);
lrd = g_slice_new (LookupRecordsData);
lrd->rrname = g_strdup (rrname);
......@@ -901,6 +906,7 @@ lookup_records_async (GResolver *resolver,
LookupRecordsData *lrd;
task = g_task_new (resolver, cancellable, callback, user_data);
g_task_set_source_tag (task, lookup_records_async);
lrd = g_slice_new (LookupRecordsData);
lrd->rrname = g_strdup (rrname);
......
......@@ -182,6 +182,7 @@ g_tls_database_real_verify_chain_async (GTlsDatabase *self,
args->flags = flags;
task = g_task_new (self, cancellable, callback, user_data);
g_task_set_source_tag (task, g_tls_database_real_verify_chain_async);
g_task_set_task_data (task, args, async_verify_chain_free);
g_task_run_in_thread (task, async_verify_chain_thread);
g_object_unref (task);
......@@ -258,6 +259,8 @@ g_tls_database_real_lookup_certificate_for_handle_async (GTlsDatabase
args->interaction = interaction ? g_object_ref (interaction) : NULL;
task = g_task_new (self, cancellable, callback, user_data);
g_task_set_source_tag (task,
g_tls_database_real_lookup_certificate_for_handle_async);
g_task_set_task_data (task, args, async_lookup_certificate_for_handle_free);
g_task_run_in_thread (task, async_lookup_certificate_for_handle_thread);
g_object_unref (task);
......@@ -330,6 +333,8 @@ g_tls_database_real_lookup_certificate_issuer_async (GTlsDatabase *sel
args->interaction = interaction ? g_object_ref (interaction) : NULL;
task = g_task_new (self, cancellable, callback, user_data);
g_task_set_source_tag (task,
g_tls_database_real_lookup_certificate_issuer_async);
g_task_set_task_data (task, args, async_lookup_certificate_issuer_free);
g_task_run_in_thread (task, async_lookup_certificate_issuer_thread);
g_object_unref (task);
......@@ -409,6 +414,8 @@ g_tls_database_real_lookup_certificates_issued_by_async (GTlsDatabase
args->interaction = interaction ? g_object_ref (interaction) : NULL;
task = g_task_new (self, cancellable, callback, user_data);
g_task_set_source_tag (task,
g_tls_database_real_lookup_certificates_issued_by_async);
g_task_set_task_data (task, args, async_lookup_certificates_issued_by_free);
g_task_run_in_thread (task, async_lookup_certificates_issued_by_thread);
g_object_unref (task);
......
......@@ -409,7 +409,7 @@ g_unix_connection_send_credentials_async (GUnixConnection *connection,
GTask *task;
task = g_task_new (connection, cancellable, callback, user_data);
g_task_set_source_tag (task, g_unix_connection_send_credentials_async);
g_task_run_in_thread (task, send_credentials_async_thread);
}
......@@ -670,7 +670,7 @@ g_unix_connection_receive_credentials_async (GUnixConnection *connection,
GTask *task;