This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug nptl/18435] pthread_once hangs when init routine throws an exception
- From: "msebor at redhat dot com" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Wed, 20 May 2015 19:40:02 +0000
- Subject: [Bug nptl/18435] pthread_once hangs when init routine throws an exception
- Auto-submitted: auto-generated
- References: <bug-18435-131 at http dot sourceware dot org/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=18435
--- Comment #5 from Martin Sebor <msebor at redhat dot com> ---
A data point to add to comment #3: The comment above the pthread_once
declaration in sysdeps/nptl/pthread.h indicates that glibc anticipates that
programs might throw exceptions from the init routine. The comment was added
when the __THROW decoration was removed from the function (in 2004).
Unfortunately, no test case seems to have been added along with the change.
/* Guarantee that the initialization function INIT_ROUTINE will be called
only once, even if pthread_once is executed several times with the
same ONCE_CONTROL argument. ONCE_CONTROL must point to a static or
extern variable initialized to PTHREAD_ONCE_INIT.
The initialization functions might throw exception which is why
this function is not marked with __THROW. */
extern int pthread_once (pthread_once_t *__once_control,
void (*__init_routine) (void)) __nonnull ((1, 2));
--
You are receiving this mail because:
You are on the CC list for the bug.