[NPTL] Questions about testing

Dan E trg_info at mailhaven.com
Wed Apr 22 06:45:05 UTC 2009


On Tue, 21 Apr 2009 23:25 -0400, "Dan E" <trg_info at mailhaven.com> wrote:
> A question about NPTL thread ids...
> 
> In the test/nptl programs, the first call to pthread_create() always
> returns a thread handle that has tid=0.  If I create more than 1 thread,
> the tids go 0,1,2,3 etc.  Inside libpthread/nptl/pthreadP.h the macro
> INVALID_TD_P(pd) says a tid < zero is invalid.  This is causing a lot of
> problems in the test programs.  All the tst-cancel tests fail because
> pthread_cancel() immediately rejects anything with tid=0.  Any thoughts?

I dug deeper into this and it appears that the __clone function in
libc/sysdeps/linux/mips/clone.S is missing a few parameters.  The first
one that's missing is where the kernel should write the thread id.  See
the comment about CLONE_PARENT_SETTID in
libpthread/nptl/sysdeps/pthread/createthread.c.

I'm checking glibc's implementation and it looks like it handles all 7
parameters.

-- 
http://www.fastmail.fm - The professional email service



More information about the uClibc mailing list