This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch master updated. glibc-2.20-213-g2f531bb


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  2f531bbb7b0458a303e8969f1e830467ca684443 (commit)
      from  f214ff74f46275f6f1187730ac88b8a2407393f3 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=2f531bbb7b0458a303e8969f1e830467ca684443

commit 2f531bbb7b0458a303e8969f1e830467ca684443
Author: Roland McGrath <roland@hack.frob.com>
Date:   Thu Nov 20 13:43:35 2014 -0800

    NPTL: Conditionalize asynchronous cancellation support on [SIGCANCEL].

diff --git a/ChangeLog b/ChangeLog
index 23c2244..d6a7c77 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2014-11-20  Roland McGrath  <roland@hack.frob.com>
 
+	* nptl/pthread_setcanceltype.c [!SIGCANCEL]: Return ENOTSUP early for
+	PTHREAD_CANCEL_ASYNCHRONOUS.
+	* nptl/pthread_cancel.c [!SIGCANCEL]: Just abort rather than trying to
+	send SIGCANCEL.
+
 	* nptl/default-sched.h: New file.
 	* sysdeps/unix/sysv/linux/default-sched.h: New file.
 	* nptl/pthread_create.c: Include it.
diff --git a/nptl/pthread_cancel.c b/nptl/pthread_cancel.c
index aeba1ff..5e645e4 100644
--- a/nptl/pthread_cancel.c
+++ b/nptl/pthread_cancel.c
@@ -18,8 +18,9 @@
 
 #include <errno.h>
 #include <signal.h>
+#include <stdlib.h>
 #include "pthreadP.h"
-#include "atomic.h"
+#include <atomic.h>
 #include <sysdep.h>
 
 
@@ -63,6 +64,7 @@ pthread_cancel (th)
 						    oldval))
 	    goto again;
 
+#ifdef SIGCANCEL
 	  /* The cancellation handler will take care of marking the
 	     thread as canceled.  */
 	  INTERNAL_SYSCALL_DECL (err);
@@ -80,13 +82,20 @@ pthread_cancel (th)
 
 	  if (INTERNAL_SYSCALL_ERROR_P (val, err))
 	    result = INTERNAL_SYSCALL_ERRNO (val, err);
+#else
+          /* It should be impossible to get here at all, since
+             pthread_setcanceltype should never have allowed
+             PTHREAD_CANCEL_ASYNCHRONOUS to be set.  */
+          abort ();
+#endif
 
 	  break;
 	}
 
-	/* A single-threaded process should be able to kill itself, since there is
-	   nothing in the POSIX specification that says that it cannot.  So we set
-	   multiple_threads to true so that cancellation points get executed.  */
+	/* A single-threaded process should be able to kill itself, since
+	   there is nothing in the POSIX specification that says that it
+	   cannot.  So we set multiple_threads to true so that cancellation
+	   points get executed.  */
 	THREAD_SETMEM (THREAD_SELF, header.multiple_threads, 1);
 #ifndef TLS_MULTIPLE_THREADS_IN_TCB
 	__pthread_multiple_threads = *__libc_multiple_threads_ptr = 1;
diff --git a/nptl/pthread_setcanceltype.c b/nptl/pthread_setcanceltype.c
index fb1631f..32646dc 100644
--- a/nptl/pthread_setcanceltype.c
+++ b/nptl/pthread_setcanceltype.c
@@ -26,12 +26,15 @@ __pthread_setcanceltype (type, oldtype)
      int type;
      int *oldtype;
 {
-  volatile struct pthread *self;
-
   if (type < PTHREAD_CANCEL_DEFERRED || type > PTHREAD_CANCEL_ASYNCHRONOUS)
     return EINVAL;
 
-  self = THREAD_SELF;
+#ifndef SIGCANCEL
+  if (type == PTHREAD_CANCEL_ASYNCHRONOUS)
+    return ENOTSUP;
+#endif
+
+  volatile struct pthread *self = THREAD_SELF;
 
   int oldval = THREAD_GETMEM (self, cancelhandling);
   while (1)

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                    |    5 +++++
 nptl/pthread_cancel.c        |   17 +++++++++++++----
 nptl/pthread_setcanceltype.c |    9 ++++++---
 3 files changed, 24 insertions(+), 7 deletions(-)


hooks/post-receive
-- 
GNU C Library master sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]