pthread_cancel() on a SCHED_RR thread hangs

Michael Hunold hunold at linuxtv.org
Thu Nov 2 14:01:07 UTC 2006


Hello all,

I'm using uClibc 0.9.28 from a straight forward gcc 4.0.3 toolchain
created with buildroot using a MIPS BE processor.

Please have a look at the attached program.

/opt/mips/bin/mips-linux-uclibc-gcc -static pthread_cancel.c -o
pthread_cancel -lpthread

When being run on the target, you can see that pthread_cancel() does not
return. The "after pthread_cancel()" is not printed, it just hangs:

# ./pthread_cancel
before select()
before pthread_cancel()
cleanup_handler()

When you disable setting SCHED_RR by changing the #if 1 to #if 0, then
the program works as expected.

# ./pthread_cancel
before select()
before pthread_cancel()
after pthread_cancel()
cleanup_handler()

Does anybody have a clue what is going wrong here? Is pthread_cancel()
supposed to work on a SCHED_RR thread?

Best regards
Michael.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pthread_cancel.c
Type: text/x-csrc
Size: 1856 bytes
Desc: not available
Url : http://lists.busybox.net/pipermail/uclibc/attachments/20061102/a84b2e2f/attachment-0002.c 


More information about the uClibc mailing list