lua-users home
lua-l archive

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


The re-entrant gmtime_r() and localtime_r() are not ANSI C, I believe.  
You can provide a patch but inclusion of non-ANSI C features has  
seemed to be a 'no'. Maybe this will change, eventually.
"The asctime_r(), ctime_r(), gmtime_r(), and localtime_r() functions  
are expected to conform to ISO/IEC 9945-1:1996 (``POSIX.1'')"
Can you post a case where using such functions really presents a  
hazard, in a multithreaded application?
Why do you think 'system' is a problem?  Maybe it's been on the  
warning list because when you launch external programs, there's no  
guarantee how multithread unfriendly they could be? I find no problem  
with 'system()' itself.
-asko



George Neill kirjoitti 12.6.2009 kello 3:11:

Hi All,

Thanks for awesome Lua language, this is my first post to the mailing list!
I did a quick double check for some known non-reentrant functions and
I found a handful of potential MT issues in loslib.c

os_execute calls system() not MT safe.
os_date calls either gmtime() or localtime() both are not MT safe.

... possibly others?

I'd like to fix those which can be fixed and provide a patch, would it
be preferable to enable a macro named something like
LUA_USE_REENTRANT?

TIA,
George