]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
* pthread_getattr_np.c: No need to install a cancellation handler,
authorUlrich Drepper <drepper@redhat.com>
Wed, 30 May 2007 04:45:03 +0000 (04:45 +0000)
committerUlrich Drepper <drepper@redhat.com>
Wed, 30 May 2007 04:45:03 +0000 (04:45 +0000)
this is no cancellation point.
* pthread_getschedparam.c: Likewise.
* pthread_setschedparam.c: Likewise.
* pthread_setschedprio.c: Likewise.
* sysdeps/unix/sysv/linux/lowlevellock.c: Remove all traces of
lll_unlock_wake_cb.
* sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Likewise.
* sysdeps/unix/sysv/linux/i386/lowlevellock.h: Likewise.
* sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
* sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
* sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
* sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
* sysdeps/unix/sysv/linux/sh/lowlevellock.S: Likewise.
* sysdeps/unix/sysv/linux/sh/lowlevellock.h: Likewise.
* sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
* sysdeps/unix/sysv/linux/sparc/sparc32/lowlevellock.c: Likewise.
* sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
* sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.

18 files changed:
nptl/ChangeLog
nptl/pthread_getattr_np.c
nptl/pthread_getschedparam.c
nptl/pthread_setschedparam.c
nptl/pthread_setschedprio.c
nptl/sysdeps/unix/sysv/linux/alpha/lowlevellock.h
nptl/sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
nptl/sysdeps/unix/sysv/linux/i386/lowlevellock.h
nptl/sysdeps/unix/sysv/linux/ia64/lowlevellock.h
nptl/sysdeps/unix/sysv/linux/lowlevellock.c
nptl/sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
nptl/sysdeps/unix/sysv/linux/s390/lowlevellock.h
nptl/sysdeps/unix/sysv/linux/sh/lowlevellock.S
nptl/sysdeps/unix/sysv/linux/sh/lowlevellock.h
nptl/sysdeps/unix/sysv/linux/sparc/lowlevellock.h
nptl/sysdeps/unix/sysv/linux/sparc/sparc32/lowlevellock.c
nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h

index 285c3793f83d3b82ab7634fb09235f5329bf5c99..09a05c1fba4953113f26ea6fe651a95cc8c4e86e 100644 (file)
@@ -1,8 +1,24 @@
 2007-05-29  Ulrich Drepper  <drepper@redhat.com>
 
-       * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
-       (__lll_mutex_unlock_wake): Add back label '1' which went AWOL quite
-       some time ago.
+       * pthread_getattr_np.c: No need to install a cancellation handler,
+       this is no cancellation point.
+       * pthread_getschedparam.c: Likewise.
+       * pthread_setschedparam.c: Likewise.
+       * pthread_setschedprio.c: Likewise.
+       * sysdeps/unix/sysv/linux/lowlevellock.c: Remove all traces of
+       lll_unlock_wake_cb.
+       * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Likewise.
+       * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Likewise.
+       * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
+       * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
+       * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
+       * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
+       * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Likewise.
+       * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Likewise.
+       * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
+       * sysdeps/unix/sysv/linux/sparc/sparc32/lowlevellock.c: Likewise.
+       * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
+       * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
 
        * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Checking
        whether there are more than one thread makes no sense here since
index 4bdc7b5b150a853e26162f4c342257b9a1642f4d..9c0e4ed8666da65042e65123cfda4089bbf580cc 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003, 2004, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003, 2004, 2006, 2007 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
 
@@ -39,10 +39,6 @@ pthread_getattr_np (thread_id, attr)
   struct pthread_attr *iattr = (struct pthread_attr *) attr;
   int ret = 0;
 
-  /* We have to handle cancellation in the following code since we are
-     locking another threads desriptor.  */
-  pthread_cleanup_push ((void (*) (void *)) lll_unlock_wake_cb, &thread->lock);
-
   lll_lock (thread->lock);
 
   /* The thread library is responsible for keeping the values in the
@@ -175,7 +171,5 @@ pthread_getattr_np (thread_id, attr)
 
   lll_unlock (thread->lock);
 
-  pthread_cleanup_pop (0);
-
   return ret;
 }
index 434d8677799e7f3fc6f55ba6abe376ccdf6dbedb..5e8713016e0c31b24577d331d1483d1e4d793000 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003, 2004, 2007 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
 
@@ -38,10 +38,6 @@ __pthread_getschedparam (threadid, policy, param)
 
   int result = 0;
 
-  /* We have to handle cancellation in the following code since we are
-     locking another threads descriptor.  */
-  pthread_cleanup_push ((void (*) (void *)) lll_unlock_wake_cb, &pd->lock);
-
   lll_lock (pd->lock);
 
   /* The library is responsible for maintaining the values at all
@@ -74,8 +70,6 @@ __pthread_getschedparam (threadid, policy, param)
 
   lll_unlock (pd->lock);
 
-  pthread_cleanup_pop (0);
-
   return result;
 }
 strong_alias (__pthread_getschedparam, pthread_getschedparam)
index 30ac6b3e8911d8ab7d77513ad5fff11618bd51a4..8129dec82c013e9402eb8d3d7eadb22f54f052ac 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003, 2004, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003, 2004, 2006, 2007 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
 
@@ -39,10 +39,6 @@ __pthread_setschedparam (threadid, policy, param)
 
   int result = 0;
 
-  /* We have to handle cancellation in the following code since we are
-     locking another threads desriptor.  */
-  pthread_cleanup_push ((void (*) (void *)) lll_unlock_wake_cb, &pd->lock);
-
   lll_lock (pd->lock);
 
   struct sched_param p;
@@ -73,8 +69,6 @@ __pthread_setschedparam (threadid, policy, param)
 
   lll_unlock (pd->lock);
 
-  pthread_cleanup_pop (0);
-
   return result;
 }
 strong_alias (__pthread_setschedparam, pthread_setschedparam)
index 4a71f6c7b3973871fddcd3e63d9c738a8878eb27..59462ec2a1c92c780e129f31175d2279bb9108ad 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003, 2004, 2007 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
 
@@ -41,10 +41,6 @@ pthread_setschedprio (threadid, prio)
   struct sched_param param;
   param.sched_priority = prio;
 
-  /* We have to handle cancellation in the following code since we are
-     locking another threads desriptor.  */
-  pthread_cleanup_push ((void (*) (void *)) lll_unlock_wake_cb, &pd->lock);
-
   lll_lock (pd->lock);
 
   /* If the thread should have higher priority because of some
@@ -66,7 +62,5 @@ pthread_setschedprio (threadid, prio)
 
   lll_unlock (pd->lock);
 
-  pthread_cleanup_pop (0);
-
   return result;
 }
index 58b4806eb251280a3533c1cee79c1b68f7e818fc..04ac0064003452639565f2bcafde62bce1463eb7 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003, 2004, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 2003, 2004, 2006, 2007 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -237,8 +237,6 @@ typedef int lll_lock_t;
 #define LLL_LOCK_INITIALIZER           (0)
 #define LLL_LOCK_INITIALIZER_LOCKED    (1)
 
-extern int lll_unlock_wake_cb (int *__futex) attribute_hidden;
-
 /* The states of a lock are:
     0  -  untaken
     1  -  taken by one user
index 1c47b37bb07da4b772e11de10201ce0c4acce702..cfcc7dafc491ab0ffe25aeb90bdec9f7e8f99482 100644 (file)
@@ -219,35 +219,6 @@ __lll_mutex_timedlock_wait:
 #endif
 
 
-#ifdef NOT_IN_libc
-       .globl  lll_unlock_wake_cb
-       .type   lll_unlock_wake_cb,@function
-       .hidden lll_unlock_wake_cb
-       .align  16
-lll_unlock_wake_cb:
-       pushl   %ebx
-       pushl   %ecx
-       pushl   %edx
-
-       movl    20(%esp), %ebx
-       LOCK
-       subl    $1, (%ebx)
-       je      1f
-
-       movl    $FUTEX_WAKE, %ecx
-       movl    $1, %edx        /* Wake one thread.  */
-       movl    $SYS_futex, %eax
-       movl    $0, (%ebx)
-       ENTER_KERNEL
-
-1:     popl    %edx
-       popl    %ecx
-       popl    %ebx
-       ret
-       .size   lll_unlock_wake_cb,.-lll_unlock_wake_cb
-#endif
-
-
        .globl  __lll_mutex_unlock_wake
        .type   __lll_mutex_unlock_wake,@function
        .hidden __lll_mutex_unlock_wake
index b89d5dd7d1459be08a8340c0ee07de6199752104..aa963f77e7ad2b21f65664bda2e6d216b91085e9 100644 (file)
@@ -449,7 +449,6 @@ extern int __lll_lock_wait (int val, int *__futex)
      __attribute ((regparm (2))) attribute_hidden;
 extern int __lll_unlock_wake (int *__futex)
      __attribute ((regparm (1))) attribute_hidden;
-extern int lll_unlock_wake_cb (int *__futex) attribute_hidden;
 
 
 /* The states of a lock are:
index 8df997a2627a6c2eec8a8ea1f1d7e448a2460775..17093471d3e5c39c7a298d77638a9f9308b97a21 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003, 2004, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 2003, 2004, 2006, 2007 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
 
@@ -226,8 +226,6 @@ extern int __lll_robust_timedlock_wait (int *futex, const struct timespec *)
 /* Type for lock object.  */
 typedef int lll_lock_t;
 
-extern int lll_unlock_wake_cb (int *__futex) attribute_hidden;
-
 /* Initializers for lock.  */
 #define LLL_LOCK_INITIALIZER           (0)
 #define LLL_LOCK_INITIALIZER_LOCKED    (1)
index 932e27300f8a46f504f0621bc9f3a91d38c83a7e..38d78884d4b7ab2fa7b3e285176db07a68ad5bb2 100644 (file)
@@ -1,5 +1,5 @@
 /* low level locking for pthread library.  Generic futex-using version.
-   Copyright (C) 2003 Free Software Foundation, Inc.
+   Copyright (C) 2003, 2007 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Paul Mackerras <paulus@au.ibm.com>, 2003.
 
@@ -76,20 +76,8 @@ __lll_timedlock_wait (int *futex, const struct timespec *abstime)
 }
 
 
-/* These don't get included in libc.so  */
+/* This function doesn't get included in libc.so  */
 #ifdef IS_IN_libpthread
-int
-lll_unlock_wake_cb (int *futex)
-{
-  int val = atomic_exchange_rel (futex, 0);
-
-  if (__builtin_expect (val > 1, 0))
-    lll_futex_wake (futex, 1);
-
-  return 0;
-}
-
-
 int
 __lll_timedwait_tid (int *tidp, const struct timespec *abstime)
 {
@@ -127,5 +115,4 @@ __lll_timedwait_tid (int *tidp, const struct timespec *abstime)
 
   return 0;
 }
-
 #endif
index 71fede838487397b77ce9976b8c3400024913d15..20547f94f20210362bdfd1189b25163aa44f5e6e 100644 (file)
@@ -263,8 +263,6 @@ typedef int lll_lock_t;
 #define LLL_LOCK_INITIALIZER           (0)
 #define LLL_LOCK_INITIALIZER_LOCKED    (1)
 
-extern int lll_unlock_wake_cb (int *__futex) attribute_hidden;
-
 /* The states of a lock are:
     0  -  untaken
     1  -  taken by one user
index 38d9f2ac41fb3c7c740c0f7e94bc88d9494623c3..d915facba12121548a3f0d8048e1b9e45f77e1ce 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003, 2004, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 2003, 2004, 2006, 2007 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Martin Schwidefsky <schwidefsky@de.ibm.com>, 2003.
 
@@ -321,8 +321,6 @@ typedef int lll_lock_t;
 #define lll_unlock(futex)       lll_mutex_unlock (futex)
 #define lll_islocked(futex)     lll_mutex_islocked (futex)
 
-extern int lll_unlock_wake_cb (int *__futex) attribute_hidden;
-
 /* The states of a lock are:
     1  -  untaken
     0  -  taken by one user
index ac3169889fcc125a5ec499ca7a180fc9e580f8f1..3b0b66d436a76464f028dd9df020101b80f29c26 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
+/* Copyright (C) 2003, 2004, 2005, 2007 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -186,34 +186,6 @@ __lll_mutex_timedlock_wait:
 #endif
 
 
-#ifdef NOT_IN_libc
-       .globl  lll_unlock_wake_cb
-       .type   lll_unlock_wake_cb,@function
-       .hidden lll_unlock_wake_cb
-       .align  5
-       cfi_startproc
-lll_unlock_wake_cb:
-       DEC     (@r4, r2)
-       tst     r2, r2
-       bt      1f
-
-       mov     #FUTEX_WAKE, r5
-       mov     #1, r6          /* Wake one thread.  */
-       mov     #0, r7
-       mov.l   r7, @r4         /* Stores 0.  */
-       mov     #SYS_futex, r3
-       extu.b  r3, r3
-       trapa   #0x14
-       SYSCALL_INST_PAD
-
-1:     
-       rts
-        nop
-       cfi_endproc
-       .size   lll_unlock_wake_cb,.-lll_unlock_wake_cb
-#endif
-
-
        .globl  __lll_mutex_unlock_wake
        .type   __lll_mutex_unlock_wake,@function
        .hidden __lll_mutex_unlock_wake
index 0eb1f0114ce3d6b94bdf235174587fe89620fabf..be8d403e268e85b052836c62eced74e8f9a2d27f 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003, 2004, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 2003, 2004, 2006, 2007 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -344,9 +344,6 @@ typedef int lll_lock_t;
   } while (0)
 
 
-extern int lll_unlock_wake_cb (int *__futex) attribute_hidden;
-
-
 /* The states of a lock are:
     0  -  untaken
     1  -  taken by one user
index 5013922a2f6e04dcb862868305bf02ef4372d1f5..65489706630fbb2c5628cda08bdd6f5fa2a42c49 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003, 2004, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 2003, 2004, 2006, 2007 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
 
@@ -240,8 +240,6 @@ __lll_robust_mutex_timedlock (int *futex, const struct timespec *abstime,
 /* Type for lock object.  */
 typedef int lll_lock_t;
 
-extern int lll_unlock_wake_cb (int *__futex) attribute_hidden;
-
 /* Initializers for lock.  */
 #define LLL_LOCK_INITIALIZER           (0)
 #define LLL_LOCK_INITIALIZER_LOCKED    (1)
index a7611d6a88c07f000889453560b0a8f76e7d96f9..cb9578b47b6eb6891bf0031e1a638488605a7c66 100644 (file)
@@ -1,5 +1,5 @@
 /* low level locking for pthread library.  SPARC version.
-   Copyright (C) 2003, 2006 Free Software Foundation, Inc.
+   Copyright (C) 2003, 2006, 2007 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Paul Mackerras <paulus@au.ibm.com>, 2003.
 
@@ -76,20 +76,8 @@ __lll_timedlock_wait (int *futex, const struct timespec *abstime)
 }
 
 
-/* These don't get included in libc.so  */
+/* This function doesn't get included in libc.so  */
 #ifdef IS_IN_libpthread
-int
-lll_unlock_wake_cb (int *futex)
-{
-  int val = atomic_exchange_24_rel (futex, 0);
-
-  if (__builtin_expect (val > 1, 0))
-    lll_futex_wake (futex, 1);
-
-  return 0;
-}
-
-
 int
 __lll_timedwait_tid (int *tidp, const struct timespec *abstime)
 {
@@ -127,5 +115,4 @@ __lll_timedwait_tid (int *tidp, const struct timespec *abstime)
 
   return 0;
 }
-
 #endif
index b92fa5c895be0d40e61532e1395c60537a1639a8..502f1d442f9793414ca11d28849eb0b8ad10ea3c 100644 (file)
@@ -220,26 +220,6 @@ __lll_mutex_timedlock_wait:
 #endif
 
 
-#ifdef NOT_IN_libc
-       .globl  lll_unlock_wake_cb
-       .type   lll_unlock_wake_cb,@function
-       .hidden lll_unlock_wake_cb
-       .align  16
-lll_unlock_wake_cb:
-       pushq   %rsi
-       pushq   %rdx
-
-       LOCK
-       addl    $1, (%rdi)
-       jng     1f
-
-       popq    %rdx
-       popq    %rsi
-       retq
-       .size   lll_unlock_wake_cb,.-lll_unlock_wake_cb
-#endif
-
-
        .globl  __lll_mutex_unlock_wake
        .type   __lll_mutex_unlock_wake,@function
        .hidden __lll_mutex_unlock_wake
@@ -253,8 +233,7 @@ __lll_mutex_unlock_wake:
        cfi_offset(%rsi, -16)
        cfi_offset(%rdx, -24)
 
-       /* NB: the label '1' is needed by lll_unlock_wake_cb.  */
-1:     movl    $0, (%rdi)
+       movl    $0, (%rdi)
        LOAD_FUTEX_WAKE (%esi)
        movl    $1, %edx        /* Wake one thread.  */
        movl    $SYS_futex, %eax
index fbe48b37aa622c494d2884ad3ca348771ff9ec6a..d3055cbb2311944bd7d204f78fc4a88b60e19bf7 100644 (file)
@@ -455,9 +455,6 @@ typedef int lll_lock_t;
 #define LLL_LOCK_INITIALIZER_LOCKED    (1)
 
 
-extern int lll_unlock_wake_cb (int *__futex) attribute_hidden;
-
-
 /* The states of a lock are:
     0  -  untaken
     1  -  taken by one user