summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2006-11-09 08:14:00 +0000
committerMike Frysinger <vapier@gentoo.org>2006-11-09 08:14:00 +0000
commitf7dfb7453d8c0a66ba0de0446d1dcfc5afc29118 (patch)
treeeefa4530df692b0f57cbf16ef2ea042ac6f4e2da
parent087d97a0a8349e5ddb23c7476b464a0eac85409a (diff)
prevent cancellation functions from being called more than once
-rw-r--r--libpthread/linuxthreads.old/join.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/libpthread/linuxthreads.old/join.c b/libpthread/linuxthreads.old/join.c
index f249a8114..4bdc77a25 100644
--- a/libpthread/linuxthreads.old/join.c
+++ b/libpthread/linuxthreads.old/join.c
@@ -37,9 +37,13 @@ void __pthread_do_exit(void *retval, char *currentframe)
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();