Re: [Vala] Threads and closures problem

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]