lua-users home
lua-l archive

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


OK, David Jones was right (thank you) and I made an incredibly
silly assumption. If I might restate the problem:

I have a number of Lua threads that each have their own environment,
I have *a* function which will execute in each of the threads,
I wish to set the function environment (lua_setfenv()) of the function
to the thread environment.
How do I do this without doing a lua_load() for *each* thread?
Is there anyway (from C) having initially loaded the function to
create a separate closure for each thread?

David Burgess

David Jones wrote:
> Isn't this explained by there only being one function that is shared
> by all your threads?