Re: [Vala] Threads and closures problem
- From: "Jan Hudec" <bulb ucw cz>
- To: "JM" <interflug1 gmx net>
- Cc: vala-list <vala-list gnome org>
- Subject: Re: [Vala] Threads and closures problem
- Date: Fri, 15 Jan 2010 12:16:53 +0100 (CET)
On Thu, January 14, 2010 21:22, JM wrote:
Hi all
Looks like closures and threads are incompatible right now.
This is the ccode generated from vala.
Of course. You can't just add 'owned' to a delegate parameter and think
things will work -- it changes the corresponding C signature by adding
the destroy notify callback.
Now unfortunately neither g_thread_create NOR g_thread_create_full have
destroy_notify function, so they CAN'T be bound with owned delegate.
You'll have to keep the closure around yourself.
I believe it makes sense to file a feature request against Glib to add
a variant of g_thread_create with destroy notify, but of course it will
take time before it gets to a stable release.
--
- Jan Hudec <bulb ucw cz>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]