[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Coroutines and lua_close()
- From: "Robert G. Jakabosky" <bobby@...>
- Date: Tue, 17 Mar 2009 13:15:03 -0700
On Tuesday 17, firstname.lastname@example.org wrote:
> So given the code above: Is there any difference between calling
> lua_close() on pChild or on pParent?
> I know that I've not to call lua_close(pChild); to cleanup anything,
> because coroutines are subject to GC. I'm just asking to get better
> understanding of inner mechanics.
No, calling lua_close() on either the child or the parent thread will free the
mainthread and all child threads.
First line from lua_close():
L = G(L)->mainthread; /* only the main thread can be closed */
So it always switches to the mainthread.
Robert G. Jakabosky