[M3commit] CVS Update: cm3
Jay Krell
jkrell at elego.de
Thu Apr 15 15:58:41 CEST 2010
CVSROOT: /usr/cvs
Changes by: jkrell at birch. 10/04/15 15:58:41
Modified files:
cm3/m3-libs/m3core/src/: m3core.h
cm3/m3-libs/m3core/src/time/POSIX/: DatePosix.i3 DatePosix.m3
DatePosixC.c
Log message:
Always use the non-_r funtions, as they have clearer/stronger
guarantees regarding timezone.
Bracketed with DisableScheduling/EnableScheduling.
Which correctly do nothing on most platforms (except user threads)
Note: that if testing shows that hpux/interix/cygwin/Solaris
keep the timezone information up to date even in _r calls,
then _r calls are probably preferred.
It is faster to not require thread locals.
I don't have overly strong feelings on this stuff.
The historical behavior was to use non-_r on "Posix" (Solaris),
_r on "BSD" (everything else), and only call tzset
Yet another historical bug in these parts is ignoring
the return value of localtime/localtime_r/gmtime/gmtime_r.
They return NULL for errors.
I have added asserts at least.
Another thing to consider.
Probably should OSErrorPosix.Raise().
Oh, wait, "historical", is all unclear.
It appears DatePosix.m3 5.1 changes never escaped their branch!
You can see comments in the 5.1 branch that they also use non-r
for its tzset effect.
Note that when we switch to time64 (soon!) that will be additional
reason probably to use _r, since time64 uses globals not
thread locals (the thing to do probably is use the storage
returned by the system's localtime()).
These later changes not as well tested as the original large change.
More information about the M3commit
mailing list