cleanup handlers and sem_wait ....
webmyster@laposte.net
webmyster@laposte.net
Wed Mar 23 17:22:00 GMT 2005
Jakub Jelinek wrote:
>On Tue, Mar 22, 2005 at 03:03:14PM +0100, webmyster@laposte.net wrote:
>
>
>>I have a problem with cleanup handlers and sem_wait with the small
>>program attached under linux.
>>On a first computer (glibc 2.3.4, gcc 3.3.3, kernel 2.6.8.1), when I
>>compile it with g++, although the thread seems to close, the cleanup
>>handler is not call. When I compile the programm with gcc, no problem
>>occurs : the cleanup handler is call and the thread stop.
>>
>>
>
>Works just fine here, glibc 2.3.4, gcc 3.4.3, kernel 2.6.10,
>with all of
>gcc
>g++
>gcc -I/usr/include/nptl -L/usr/lib64/nptl
>g++ -I/usr/include/nptl -L/usr/lib64/nptl
>
>testCancel is called in all cases.
>
>
I updated my system : gcc 3.4.3, glib 2.3.4 (compiled with gcc 3.3.3),
linux kernel 2.6.11.4 (also compiled with gcc 3.3.3).
The same problem occurs !
Actually, it seems that the problem comes from the definition of
pthread_cleanup_push and pthread_cleanup_pop.
I modified my pthread.h file. Now, it don't use the first definitions
that use the __cleanup__ C attribut (through classes or explicit
definition). It is using the __pthread_register_cancel and
__pthread_unregister_cancel functions.
With this modification, the program is working just fine : the
testCancle is called.
Damien Touraine
More information about the Glibc-bugs
mailing list