svn commit: trunk/uClibc/libpthread/linuxthreads.old
vapier at uclibc.org
vapier at uclibc.org
Thu Nov 9 08:14:00 UTC 2006
Author: vapier
Date: 2006-11-09 00:14:00 -0800 (Thu, 09 Nov 2006)
New Revision: 16525
Log:
prevent cancellation functions from being called more than once
Modified:
trunk/uClibc/libpthread/linuxthreads.old/join.c
Changeset:
Modified: trunk/uClibc/libpthread/linuxthreads.old/join.c
===================================================================
--- trunk/uClibc/libpthread/linuxthreads.old/join.c 2006-11-09 08:11:33 UTC (rev 16524)
+++ trunk/uClibc/libpthread/linuxthreads.old/join.c 2006-11-09 08:14:00 UTC (rev 16525)
@@ -37,9 +37,13 @@
struct pthread_request request;
PDEBUG("self=%p, pid=%d\n", self, self->p_pid);
- /* Reset the cancellation flag to avoid looping if the cleanup handlers
- contain cancellation points */
- THREAD_SETMEM(self, p_canceled, 0);
+ /* obey POSIX behavior and prevent cancellation functions from
+ * being called more than once.
+ * http://sourceware.org/ml/libc-ports/2006-10/msg00043.html
+ */
+ THREAD_SETMEM(self, p_cancelstate, PTHREAD_CANCEL_DISABLE);
+ THREAD_SETMEM(self, p_canceltype, PTHREAD_CANCEL_DEFERRED);
+
/* Call cleanup functions and destroy the thread-specific data */
__pthread_perform_cleanup(currentframe);
__pthread_destroy_specifics();
More information about the uClibc-cvs
mailing list