[PATCHv2][BZ #13613] Allow a single-threaded process to cancel itself

Siddhesh Poyarekar siddhesh@redhat.com
Thu May 10 20:02:00 GMT 2012


Hi,

Here's an updated patch to allow a single-threaded process to cancel
itself. The code change is essentially the same, except that I have
added comments in a number of places as per Carlos' suggestion to
explain what multiple_threads is all about. I have also added test cases
for pthread_testcancel, pthread_setcanceltype and
pthread_setcancelstate in addition to the earlier test case. Patch
attached.

Regards,
Siddhesh


nptl/ChangeLog:

2012-05-11  Siddhesh Poyarekar  <siddhesh@redhat.com>
	    Jakub Jelinek <jakub@redhat.com>

	[BZ #13613]
	* Makefile (tests): Add test cases.
	* descr.h (struct pthread): Add a comment describing
	multiple_threads.
	* pthreadP.h (__pthread_multiple_threads): Expand comment to
	include single-process case.
	* pthread_cancel.c (pthread_cancel): Enable multiple_threads
	before setting cancelstate of the thread.
	* sysdeps/unix/sysv/linux/libc_multiple_threads.c
	(__libc_multiple_threads): Add explanatory comment.
	* tst-cancel-self-cancelstate.c: New test case.
	* tst-cancel-self-canceltype.c: Likewise.
	* tst-cancel-self-cleanup.c: Supporting file for test cases.
	* tst-cancel-self-testcancel.c: New test case.
	* tst-cancel-self.c: Likewise.
	* vars.c: Expand comment to include single-process case.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pthread-cancel-self.patch
Type: text/x-patch
Size: 13115 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20120510/be9f0010/attachment.bin>


More information about the Libc-alpha mailing list