[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: abort a lua_newthread from C and re-use its lua_State?
- From: Shmuel Zeigerman <shmuz@...>
- Date: Sat, 12 May 2007 13:28:54 +0200
Graham Wakefield wrote:
This won't work. The registry is shared between the main state and all
child states created within it.
You're right. I wrongly assumed that each coroutine had its
own registry. Thanks for pointing that out!
Then, Rici's advice is probably the best.
There is (at least) one more way to achieve that goal: create
a userdata with a __gc method and put it on the coroutine's
stack (say, as the 1-st parameter to the coroutine's main function).
(Tested today, and seems to work).
--
Shmuel