> On Sat, Sep 22, 2012 at 8:26 PM, Stefan Weil <s...@weilnetz.de> wrote: >> Those functions are missing in MinGW. >> >> Some versions of MinGW-w64 include defines for gmtime_r and localtime_r. >> Older versions of these macros are buggy (they return a pointer to a >> static variable), therefore we don't want them. Newer versions are >> similar to the code used here, but without the memset. >> >> The implementation which is used here is not strictly reentrant, >> but sufficiently good for QEMU on w32 or w64. > > For now, but nothing shows that there is a problem. Adding a few > simple locks shouldn't be difficult, or FIXME/XXX comment otherwise. >
Does (or will) QEMU support preemptive scheduling of threads? If not, there is no reentrancy problem because gmtime / localtime don't trigger scheduling. Of course adding comments is always a good idea. Feel free to add one or wait until I send a v2 patch. Regards Stefan