Re: Fwd: glib thread create API



On Tue, Nov 12, 2013 at 12:33 PM, Ryan Lortie <desrt desrt ca> wrote:
On Tue, Nov 12, 2013, at 12:47, Jonathan S. Shapiro wrote:
> Actually, given your explanation, I think that a very simple change to
> the current API would likely suffice for everything I need, and would
> be fully portable:
>
>    g_thread_register_cleanup_function(void (*)(GThread));

You can use GPrivate to get this effect -- allocate something in a
GPrivate and during thread teardown, the cleanup handler for that thing
will be called.

Hope that helps.

Yes, that certainly *does* help, and thanks again. I'll wander off and give all this a try, and then see if there's a way to write up an app note on it.

Meanwhile, do you think the doc changes I proposed seem sensible? Far as I can tell, they're just making the current behavioral contract explicit. If they make sense, I can submit a but report with a patch in the next few days.


shap 


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