clock_nanosleep cancellation problem

Jakub Jelinek jakub@redhat.com
Mon Jun 16 10:39:00 GMT 2003


Hi!

The following change:
        * sysdeps/unix/clock_nanosleep.c: Add cancellation support.
        * sysdeps/unix/sysv/linux/clock_nanosleep.c: Likewise.
breaks x86_64 and supposedly all arches which use library local variable
instead of a field in struct pthread for multiple_threads.
../sysdeps/unix/clock_nanosleep.c:97: undefined reference to `__libc_multiple_threads'
make[2]: *** [/usr/src/build/269611-x86_64/BUILD/glibc-2.3.2-200306160509/build-x86_64-linuxnptl/rt/librt.so]
Error 1

Possible fix could be
a) add multiple_threads struct pthread field unconditionally and set it
   (on thread creation) in addition to __libc_multiple_threads and
   __pthread_multiple_threads, in sysdep-cancel.h use
   __libc_multiple_threads in libc.so, __pthread_multiple_threads in
   libpthread.so and THREAD_SELF->multiple_threads in other libraries
b) add __librt_multiple_threads and some hooks to initialize it

Also, linuxthreads needs the same changes as NPTL, otherwise linuxthreads
doesn't compile at all. I can write a patch for linuxthreads, but
would like to know which way to go in NPTL/x86_64 etc. first, as
linuxthreads will do the same.

	Jakub



More information about the Libc-hacker mailing list