summaryrefslogtreecommitdiff
path: root/gck/test-gck-module.c
diff options
context:
space:
mode:
authorMarco Trevisan (Treviño) <mail@3v1n0.net>2020-11-16 16:56:14 +0100
committerMarco Trevisan (Treviño) <mail@3v1n0.net>2021-01-19 22:37:28 +0100
commited23f8b97128fbd26faec1bff3da35d64afa305b (patch)
tree30aca4608676329d05d2ba8133996f9149ec7ba0 /gck/test-gck-module.c
parentf1f1a85026f04f32a53269c104b72f187f1c5b47 (diff)
downloadgcr-ed23f8b97128fbd26faec1bff3da35d64afa305b.tar.gz
gck-call: Simplify the code by using GTask based implementation
GckCall uses its own implementation of threads pool to handle the async calls, now that we've GTask this code can be simplified by reusing GLib code. I didn't want to change the API in this commit, even if private not to mix changes together, so the functions still are used as they used to be The main difference is that the async_pre and async_ready prepare a GTask instance, while the async_go starts a thread using the gtask function. Callback functions needed to be adapted to the new GAsyncResult type. Tests needed also some tuning as the underneath task holding a reference to the source object might be finalized at later stage, when the thread-related data is removed, as per this we may wait a bit to check whether a source object gets finalized, this is due to GNOME/GLib#1346.
Diffstat (limited to 'gck/test-gck-module.c')
-rw-r--r--gck/test-gck-module.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/gck/test-gck-module.c b/gck/test-gck-module.c
index 1e9d658..91e7e4d 100644
--- a/gck/test-gck-module.c
+++ b/gck/test-gck-module.c
@@ -51,6 +51,7 @@ static void
teardown (Test *test, gconstpointer unused)
{
g_object_unref (test->module);
+ egg_test_wait_for_gtask_thread (test->module);
g_assert_null (test->module);
}