[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re[5]: lua_closethread
- From: "Nodir Temirhodzhaev" <tnodir@...>
- Date: Mon, 14 Jul 2003 10:26:36 +0400
> >> I think it is not necessary to close thread by any function.
> >> Threads is stored in the lua state and garbage-collected
> >> like tables or functions.
>
> NT> I believe this is correct, but a little confusing, because the handle
> NT> you have for your thread/coroutine is a lua_State*.
>
> IMHO, this is like userdata. They stored in lua state and the same
> time have "real world" (outside of lua state) pointers.
Next code incorrect?
--------
lua_State *thr = lua_newthread (L);
lua_pop (L, 1);
lua_pushnil (thr);
--------
Ie in lua tables not exist reference to thread and it collected?
IMO, userdata stored in table. Is it correct store pointer to userdata outside lua tables? GC may change it's location?