
Jonathan Wakely wrote:
Jonathan Turkanis wrote:
Pavel Vozenilek wrote:
"Jason Hise" wrote:
Why does it require that the function which is called once not be allowed to throw? I am not sure that I can meet this requirement, as I may need to dynamically allocate memory.
Possibly because of internal implementation.
I think it's a pthreads requirement.
Pthreads knows nothing about exceptions,
That's not true. http://www.opengroup.org/onlinepubs/009695399/functions/pthread_once.html "The pthread_once() function is not a cancellation point. However, if init_routine is a cancellation point and is canceled, the effect on once_control shall be as if pthread_once() was never called." http://www.opengroup.org/onlinepubs/009695399/functions/pthread_cleanup_push... "Note that the specified cleanup handling mechanism is especially tied to the C language and, while the requirement for a uniform mechanism for expressing cleanup is language-independent, the mechanism used in other languages may be quite different. In addition, this mechanism is really only necessary due to the lack of a real exception mechanism in the C language, which would be the ideal solution." http://www.opengroup.org/onlinepubs/009695399/xrat/xsh_chap02.html#tag_03_02... "...it is an explicit goal of IEEE Std 1003.1-2001 to be compatible with existing exception facilities and languages having exceptions." regards, alexander. P.S. http://groups.google.de/group/comp.std.c++/msg/20a156f0b068c9e1