ISO/IEC JTC1 SC22 WG21 N2864 = 09-0054 - 2009-03-21
ISO/IEC JTC 1/SC 22/WG 14 N1371 - 2009-03-21
Lawrence Crowl, email@example.com, Lawrence@Crowl.org
P.J. Plauger, firstname.lastname@example.org
Nick Stoughton, USENIX, email@example.com
This paper is a revision of ISO/IEC JTC1 SC22 WG21 N2827 = 09-0017 - 2009-02-07.
Revisions consist of:
With the introduction of concurrency into the C++ standard, some functions adopted from the C standard need explicit exemption from the general prohibition on data races in 220.127.116.11 [res.on.data.races].
The following functions are already exempted in 20.9 [date.time].
asctime ctime gmtime localtime
The following functions are already exempted in 21.5 [c.strings].
The following functions are already exempted in 26.7 [c.math].
The following functions may have previously been thread unsafe, but must be thread safe to enable effective programming. By failng to mention these functions, the standard implicitly requires them to be thread safe.
atexit at_quick_exit exit fclose free quick_exit malloc signal
The draft standard does not say what happens
when a call to
does not happen before
We propose to make whether or not the function is registered unspecified.
The Posix/C++ Binding group suggests that
LWG issue 708 be closed as Not-A-Defect.
C++ locale objects are already adequate for thread-safe locales;
setlocale() is thread-unsafe.
The wording changes are relative to N2800.
Edit paragraph 4 as follows.
atexit()functions register the function pointed to by
fto be called without arguments at normal program termination.
Edit paragraph 9 as follows.
at_quick_exit()functions register the function pointed to by
fto be called without arguments when
quick_exitis called. The
be thread safe.[Note: The
at_quick_exitregistrations are distinct from the
atexitregistrations, and applications may need to call both registration functions with the same argument. —end note]
After paragraph 4, add a new paragraph.
After paragraph 14, add a new paragraph.
Edit paragraph 2 as follows.
Effects: Causes future calls to the constructor
locale()to return a copy of the argument. If the argument has a name, does
otherwise, the effect on the C locale, if any, is implementation-defined. No library function other than
locale::global()shall affect the value returned by
After paragraph 2, add new paragraph.
After paragraph 2, add a new paragraph.
The floating-point environment has thread storage duration (3.7.2 [basic.stc.thread]). The initial state for a thread's floating-point environment is the state of the floating-point environment of the thread that constructs the corresponding
std::threadobject (30.2.1 [thread.thread.class]) at the time it constructed the object. [Note: That is, the child thread gets the floating-point state of the parent thread at the time of the child's creation. —end note]
Before "See also", add a new paragraph.