On Thu, Jun 28, 2012 at 11:22 AM, Roberto Ierusalimschy <email@example.com>
I do not think it is. Standard Lua does not offer threads. Several
other functions in the libraries are not thread safe (and will not be
if C does not offer a proper implementation). The documentation does
not state they are thread safe. (It would be somewhat awkward for a
language that does not support threads to discuss thread safety in its
documentation, but we can add it.) So, to be thread safe is a feature;
But Lua is advertised to be "reentrant and ready to be used in multithreaded code" (PIL, 2nd edition, page 219). In that case, the documentation should clarify which functions aren't thread safe.
If this is not considered a bug and it won't make it to Lua 5.1.6, at least the user that is embedding Lua in a multithreaded application would be aware of which functions needs to be overridden.
As you said in your other message, the docs for Lua 5.2 say that os.date may be not thread safe, but it would be great if it also stated which systems provides a thread safe implementation (or at least, which C function makes it unsafe).