lua-users home
lua-l archive

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

2009/7/8  <>:
> I wonder if there is a way to determine the "parent" lua_State
> of a coroutine, given its own lua_State. In other words, I am
> trying to find the lua_State a given coroutine has been created
> from.
> Is it possible ?
> For the moment I am stuck.

It is not possible. A coroutine "A" can create a coroutine "B", pass
it to a coroutine "C", and terminate. "A" was the creator of "B", but
it no longer exists. There is no coroutine ownership mechanism,
coroutines are garbage collected objects like tables or functions.