[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: rename lua_State
- From: Roberto Ierusalimschy <roberto@...>
- Date: Mon, 25 Aug 2014 15:05:09 -0300
> Consider code
> - In C having L1 as reference
> - it calls Lua code
> - The Lua code calls another C function, having L2 as reference
>
> If you name it lua_Thread, you would assume L1 and L2 would be the same, as they run on the same coroutine/thread. But they are not the same, they both have their own stack to interact with Lua.
But L1 and L2 will be the same (that is, L1 == L2)! Each routine has its
own stack, but they use the same PIET to refer to their stacks (unless
they are in different threads).
-- Roberto