Re: BUG: currupt function pthread_cleanup_push definition in /usr/include/pthread.h
>>>>> Raphael Bossek writes:
> Hi,
> compiling my source code using the pthread_cleanup_push function dropps
> misterious errors so i checked the definition of it and found that a
> '}' is missing in line 478 (libc6-dev 2.1.2-0pre12) of
> /usr/include/pthread.h.
> Please correct this in the next release.
No - your program is broken. Read the comments in <pthread.h>, e.g.:
/* Install a cleanup handler: ROUTINE will be called with arguments ARG
when the thread is cancelled or calls pthread_exit. ROUTINE will also
be called with arguments ARG when the matching pthread_cleanup_pop
is executed with non-zero EXECUTE argument.
pthread_cleanup_push and pthread_cleanup_pop are macros and must always
be used in matching pairs at the same nesting level of braces. */
The last two lines are important.
Andreas
--
Andreas Jaeger aj@arthur.rhein-neckar.de jaeger@informatik.uni-kl.de
for pgp-key finger ajaeger@aixd1.rhrk.uni-kl.de
Reply to: