|
Boost : |
From: Alexander Terekhov (terekhov_at_[hidden])
Date: 2005-08-03 05:45:05
Jonathan Wakely wrote:
>
> Jonathan Turkanis wrote:
>
> > Pavel Vozenilek wrote:
> > > "Jason Hise" wrote:
> > >
> > >>> http://www.boost.org/doc/html/call_once.html?
> > >>>
> > >> 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.html
"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_09_20
"...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
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk