Title
"thread safe" is undefined
Status
c++11
Section
[support.start.term]
Submitter
LWG

Created on 2009-06-16.00:00:00 last changed 161 months ago

Messages

Date: 2010-10-21.18:28:33

Proposed resolution:

For the following functions in [support.start.term].


extern "C" int at_quick_exit(void (*f)(void));
extern "C++" int at_quick_exit(void (*f)(void));

Edit paragraph 10 as follows. The intent is to provide the other half of the happens before relation; to note indeterminate ordering; and to clean up some formatting.

Effects: The at_quick_exit() functions register the function pointed to by f to be called without arguments when quick_exit is called. It is unspecified whether a call to at_quick_exit() that does not happen-before happen before (1.10) all calls to quick_exit will succeed. [Note: the at_quick_exit() functions shall not introduce a data race (17.6.4.7). exitnote end note] [Note: The order of registration may be indeterminate if at_quick_exit was called from more than one thread. —end note] [Note: The at_quick_exit registrations are distinct from the atexit registrations, and applications may need to call both registration functions with the same argument. —end note]

For the following function.


void quick_exit [[noreturn]] (int status)

Edit paragraph 13 as follows. The intent is to note that thread-local variables may be different.

Effects: Functions registered by calls to at_quick_exit are called in the reverse order of their registration, except that a function shall be called after any previously registered functions that had already been called at the time it was registered. Objects shall not be destroyed as a result of calling quick_exit. If control leaves a registered function called by quick_exit because the function does not provide a handler for a thrown exception, terminate() shall be called. [Note: Functions registered by one thread may be called by any thread, and hence should not rely on the identity of thread-storage-duration objects. —end note] After calling registered functions, quick_exit shall call _Exit(status). [Note: The standard file buffers are not flushed. See: ISO C 7.20.4.4. —end note]

Date: 2010-10-21.18:28:33

[ 2009 Santa Cruz: ]

The "thread safe" language has already been change in the WP. It was changed to "happen before", but the current WP text is still a little incomplete: "happen before" is binary, but the current WP text only mentions one thing.

Move to Ready.

Date: 2009-06-16.00:00:00

Addresses UK 187

The term "thread safe" is not defined nor used in this context anywhere else in the standard.

Suggested action:

Clarify the meaning of "thread safe".

History
Date User Action Args
2011-08-23 20:07:26adminsetstatus: wp -> c++11
2010-10-21 18:28:33adminsetmessages: + msg900
2010-10-21 18:28:33adminsetmessages: + msg899
2009-06-16 00:00:00admincreate