Is Lua reentrant?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Is Lua reentrant?

Paul Dixon
Is Lua reentrant? That is, can I write a C function that is called by a Lua program which in turn calls lua_dofile?

Thanks in advance,

Paul Dixon
[hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Is Lua reentrant?

Carlos Cassino
Hi Paul.

You can write a C function that is called by Lua which calls Lua again.
But Lua is not reentrant in a broader sense, I mean, you *cannot* write
a C function that calls Lua if this function is to be called by two
different threads of execution.

Regards,
-- cassino