lua-users home
lua-l archive

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

Suppose in C++ you have a reference to a coroutine created in a Lua script
(perhaps kept on the registry).  Then suppose that "resumed" coroutine makes
a call into one of my C++ functions.  Is there a way to correlate the
lua_State parameter my C++ routine has received, to the coroutine that I
already had stored in the registry?

Asking this question differently: is a lua_State the same thing/type as a
coroutine?  Presuming the answer is no, is there a way to test which
coroutine had sent my C++ routine the lua_State?  Perhaps the lua_State can
be queried to reveal which coroutine it is associated with?