RE: Bug: non-error unwind of previously yielded pcall doesn't restore errfunc.
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: RE: Bug: non-error unwind of previously yielded pcall doesn't restore errfunc.
- From: "Thijs Schreijer" <thijs@...>
- Date: 2012年7月19日 14:43:31 +0200
> 1) Determine if two threads belong to the same shared interpreter state:
>
> bool is_same_state(lua_State *L1, lua_State *L2) { return L1->l_G ==
L2->l_G; }
>
> I used this for some assertions. I believe the only way around it
> involves using the registry, and thus writing to the stack of at
> least one of the states. This way is purely symmetrical, read-only
> and fast.
I've had this one on my mind for a while, but I'm not convinced whether this
is a good idea.
Often multiple states are used with multiple threads (OS threads). Then your
code in unsafe.