]> git.ipfire.org Git - thirdparty/vala.git/commit
codegen: Use GTask instead of GSimpleAsyncResult if 2.36 target is selected 14ca2e09f9021e681947fa3f1fb5c1a6974059ae
authorCarlos Garnacho <carlosg@gnome.org>
Wed, 23 Mar 2016 14:04:37 +0000 (15:04 +0100)
committerRico Tzschichholz <ricotz@ubuntu.com>
Sat, 19 Nov 2016 11:34:31 +0000 (12:34 +0100)
commit14ca2e09f9021e681947fa3f1fb5c1a6974059ae
tree19eb719c3331843793308289851d1f5adfb68d81
parenta1dd5668f7915a45e8f3c0650fa68f11d7c99730
codegen: Use GTask instead of GSimpleAsyncResult if 2.36 target is selected

GTask brings some differences compared to GSimpleAsyncResult. Most namely,
g_task_return*() operations perform at once the async result data asignment
and the caller's main context activation. This is something that has to be
done exactly once, so the code flow has slight changes to ensure that.

Also, the async operation data used to be attached early through
g_simple_async_result_set_op_res_gpointer, only to be maybe replaced by
the real return data. If GTask is being used, we set this data through
g_task_set_task_data().

There's code out there relying on immediate return here when state is
!=0. As GTask always defers the finalization to an idle in its main
context, ensure the source is dispatched and the task completed before
returning.

https://bugzilla.gnome.org/show_bug.cgi?id=763345
codegen/valaccodemethodmodule.vala
codegen/valagasyncmodule.vala
codegen/valagdbusclientmodule.vala