Re: doubt about thread pool



On 6 December 2011 11:49, Marcelo Elias Del Valle - SYSMAP SOLUTIONS -
Claro MA-SP - <Marcelo Valle claro com br> wrote:
>        When I call g_thread_pool_push, I pass a pointer to some data I have pre-allocated and that should be processed by the thread. However, when the thread finishes processing it, I need to free this data, outside the thread.
>        How do I do that? Is there a way?

You need to send a message back from the thread saying "I'm done!"

There are many ways to do this, depending on how your program is
structured. For example, g_idle_add() is a very simple thread-safe way
for a worker to get the main GUI thread to call a function.

(this question might be better on gtk-app-devel, for future reference)

John


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]