diff options
| author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2020-02-09 01:13:56 +0100 |
|---|---|---|
| committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2020-02-09 01:27:38 +0100 |
| commit | a99155555c2134a6397584b7cdc30d7e55e070cf (patch) | |
| tree | 6de1010bd0225f33c231ac9b20a838a89a4daa33 | |
| parent | d4e209d35564eecdc006ab9f5b10bc8494c6f1f9 (diff) | |
| download | glibc-a99155555c2134a6397584b7cdc30d7e55e070cf.tar.xz glibc-a99155555c2134a6397584b7cdc30d7e55e070cf.zip | |
htl: Remove unused files
These have never been used.
27 files changed, 0 insertions, 1106 deletions
diff --git a/htl/Makefile b/htl/Makefile index b9d3831dd9..0dccf25ebc 100644 --- a/htl/Makefile +++ b/htl/Makefile @@ -61,7 +61,6 @@ libpthread-routines := pt-attr pt-attr-destroy pt-attr-getdetachstate \ pt-testcancel \ pt-cancel \ \ - pt-mutexattr \ pt-mutexattr-destroy pt-mutexattr-init \ pt-mutexattr-getprioceiling pt-mutexattr-getprotocol \ pt-mutexattr-getpshared pt-mutexattr-gettype \ diff --git a/htl/Versions b/htl/Versions index 77f7335b9c..8e0007d77c 100644 --- a/htl/Versions +++ b/htl/Versions @@ -32,8 +32,6 @@ libpthread { __errno_location; __h_errno_location; } GLIBC_2.12 { - __pthread_errorcheck_mutexattr; __pthread_recursive_mutexattr; - __pthread_get_cleanup_stack; __pthread_mutex_transfer_np; diff --git a/htl/pt-internal.h b/htl/pt-internal.h index f8d7d74244..274223cfe1 100644 --- a/htl/pt-internal.h +++ b/htl/pt-internal.h @@ -306,9 +306,6 @@ extern const struct __pthread_attr __pthread_default_attr; /* Default barrier attributes. */ extern const struct __pthread_barrierattr __pthread_default_barrierattr; -/* Default mutex attributes. */ -extern const struct __pthread_mutexattr __pthread_default_mutexattr; - /* Default rdlock attributes. */ extern const struct __pthread_rwlockattr __pthread_default_rwlockattr; diff --git a/sysdeps/htl/bits/types/struct___pthread_mutexattr.h b/sysdeps/htl/bits/types/struct___pthread_mutexattr.h index bfb786a064..b3f6ebdf68 100644 --- a/sysdeps/htl/bits/types/struct___pthread_mutexattr.h +++ b/sysdeps/htl/bits/types/struct___pthread_mutexattr.h @@ -33,8 +33,4 @@ struct __pthread_mutexattr enum __pthread_mutex_type __mutex_type; }; -/* Attributes for a recursive mutex. */ -extern const struct __pthread_mutexattr __pthread_errorcheck_mutexattr; -extern const struct __pthread_mutexattr __pthread_recursive_mutexattr; - #endif /* bits/types/struct___pthread_mutexattr.h */ diff --git a/sysdeps/htl/pt-kill.c b/sysdeps/htl/pt-kill.c deleted file mode 100644 index c6fad8f162..0000000000 --- a/sysdeps/htl/pt-kill.c +++ /dev/null @@ -1,33 +0,0 @@ -/* pthread-kill.c - Generic pthread-kill implementation. - Copyright (C) 2008-2020 Free Software Foundation, Inc. - Written by Neal H. Walfield <neal@gnu.org>. - - This file is part of the GNU Hurd. - - The GNU Hurd is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public License - as published by the Free Software Foundation; either version 3 of - the License, or (at your option) any later version. - - The GNU Hurd is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this program. If not, see - <https://www.gnu.org/licenses/>. */ - -#include <pthreadP.h> -#include "sig-internal.h" - -int -__pthread_kill (pthread_t tid, int signo) -{ - siginfo_t si; - memset (&si, 0, sizeof (si)); - si.si_signo = signo; - - return pthread_kill_siginfo_np (tid, si); -} -strong_alias (__pthread_kill, pthread_kill) diff --git a/sysdeps/htl/pt-mutex-destroy.c b/sysdeps/htl/pt-mutex-destroy.c deleted file mode 100644 index 3824e62dd4..0000000000 --- a/sysdeps/htl/pt-mutex-destroy.c +++ /dev/null @@ -1,38 +0,0 @@ -/* Destroy a mutex. Generic version. - Copyright (C) 2000-2020 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 - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - <https://www.gnu.org/licenses/>. */ - -#include <pthread.h> -#include <stdlib.h> -#include <assert.h> - -#include <pt-internal.h> - -int -_pthread_mutex_destroy (pthread_mutex_t *mutex) -{ - if (mutex->__attr == __PTHREAD_ERRORCHECK_MUTEXATTR - || mutex->__attr == __PTHREAD_RECURSIVE_MUTEXATTR) - /* Static attributes. */ - ; - else - free (mutex->__attr); - - return 0; -} - -strong_alias (_pthread_mutex_destroy, pthread_mutex_destroy); diff --git a/sysdeps/htl/pt-mutex-getprioceiling.c b/sysdeps/htl/pt-mutex-getprioceiling.c deleted file mode 100644 index 57e0877fad..0000000000 --- a/sysdeps/htl/pt-mutex-getprioceiling.c +++ /dev/null @@ -1,28 +0,0 @@ -/* Get a mutex' priority ceiling. Generic version. - Copyright (C) 2002-2020 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 - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - <https://www.gnu.org/licenses/>. */ - -#include <pthread.h> -#include <pt-internal.h> - -int -pthread_mutex_getprioceiling (const pthread_mutex_t *mutex, int *prioceiling) -{ - return ENOSYS; -} - -stub_warning (pthread_mutex_getprioceiling) diff --git a/sysdeps/htl/pt-mutex-init.c b/sysdeps/htl/pt-mutex-init.c deleted file mode 100644 index c59bd8a3f5..0000000000 --- a/sysdeps/htl/pt-mutex-init.c +++ /dev/null @@ -1,50 +0,0 @@ -/* Initialize a mutex. Generic version. - Copyright (C) 2000-2020 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 - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - <https://www.gnu.org/licenses/>. */ - -#include <pthread.h> -#include <string.h> -#include <stdlib.h> -#include <assert.h> - -#include <pt-internal.h> - -int -_pthread_mutex_init (pthread_mutex_t *mutex, const pthread_mutexattr_t *attr) -{ - *mutex = (pthread_mutex_t) __PTHREAD_MUTEX_INITIALIZER; - - ASSERT_TYPE_SIZE (pthread_mutex_t, __SIZEOF_PTHREAD_MUTEX_T); - - if (attr == NULL - || memcmp (attr, &__pthread_default_mutexattr, sizeof (*attr)) == 0) - /* The default attributes. */ - return 0; - - if (mutex->__attr == NULL - || mutex->__attr == __PTHREAD_ERRORCHECK_MUTEXATTR - || mutex->__attr == __PTHREAD_RECURSIVE_MUTEXATTR) - mutex->__attr = malloc (sizeof *attr); - - if (mutex->__attr == NULL) - return ENOMEM; - - *mutex->__attr = *attr; - return 0; -} - -strong_alias (_pthread_mutex_init, pthread_mutex_init); diff --git a/sysdeps/htl/pt-mutex-lock.c b/sysdeps/htl/pt-mutex-lock.c deleted file mode 100644 index 85d98422d8..0000000000 --- a/sysdeps/htl/pt-mutex-lock.c +++ /dev/null @@ -1,36 +0,0 @@ -/* Lock a mutex. Generic version. - Copyright (C) 2000-2020 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 - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - <https://www.gnu.org/licenses/>. */ - -#include <pthread.h> -#include <assert.h> - -#include <pt-internal.h> - -/* Implemented in pt-mutex-timedlock.c. */ -extern int __pthread_mutex_timedlock_internal (struct __pthread_mutex *mutex, - const struct timespec *abstime); - -/* Lock MUTEX, block if we can't get it. */ -int -__pthread_mutex_lock (struct __pthread_mutex *mutex) -{ - return __pthread_mutex_timedlock_internal (mutex, 0); -} - -strong_alias (__pthread_mutex_lock, _pthread_mutex_lock); -strong_alias (__pthread_mutex_lock, pthread_mutex_lock); diff --git a/sysdeps/htl/pt-mutex-setprioceiling.c b/sysdeps/htl/pt-mutex-setprioceiling.c deleted file mode 100644 index b905daf0d9..0000000000 --- a/sysdeps/htl/pt-mutex-setprioceiling.c +++ /dev/null @@ -1,28 +0,0 @@ -/* Set a mutex' priority ceiling. Generic version. - Copyright (C) 2002-2020 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 - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - <https://www.gnu.org/licenses/>. */ - -#include <pthread.h> -#include <pt-internal.h> - -int -pthread_mutex_setprioceiling (pthread_mutex_t *mutex, int prio, int *oldprio) -{ - return ENOSYS; -} - -stub_warning (pthread_mutex_setprioceiling) diff --git a/sysdeps/htl/pt-mutex-timedlock.c b/sysdeps/htl/pt-mutex-timedlock.c deleted file mode 100644 index 0e50f38ef2..0000000000 --- a/sysdeps/htl/pt-mutex-timedlock.c +++ /dev/null @@ -1,197 +0,0 @@ -/* Lock a mutex with a timeout. Generic version. - Copyright (C) 2000-2020 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 - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - <https://www.gnu.org/licenses/>. */ - -#include <pthread.h> -#include <assert.h> -#include <time.h> - -#include <pt-internal.h> - -#define LOSE do { * (int *) 0 = 0; } while (1) - -/* Try to lock MUTEX, block until *ABSTIME if it is already held. As - a GNU extension, if TIMESPEC is NULL then wait forever. */ -int -__pthread_mutex_timedlock_internal (struct __pthread_mutex *mutex, - const struct timespec *abstime) -{ - error_t err; - int drain; - struct __pthread *self; - const struct __pthread_mutexattr *attr = mutex->__attr; - - if (attr == __PTHREAD_ERRORCHECK_MUTEXATTR) - attr = &__pthread_errorcheck_mutexattr; - if (attr == __PTHREAD_RECURSIVE_MUTEXATTR) - attr = &__pthread_recursive_mutexattr; - - __pthread_spin_lock (&mutex->__lock); - if (__pthread_spin_trylock (&mutex->__held) == 0) - /* Successfully acquired the lock. */ - { -#ifdef ALWAYS_TRACK_MUTEX_OWNER -# ifndef NDEBUG - self = _pthread_self (); - if (self != NULL) - /* The main thread may take a lock before the library is fully - initialized, in particular, before the main thread has a - TCB. */ - { - assert (mutex->__owner == NULL); - mutex->__owner = _pthread_self (); - } -# endif -#endif - - if (attr != NULL) - switch (attr->__mutex_type) - { - case PTHREAD_MUTEX_NORMAL: - break; - - case PTHREAD_MUTEX_RECURSIVE: - mutex->__locks = 1; - case PTHREAD_MUTEX_ERRORCHECK: - mutex->__owner = _pthread_self (); - break; - - default: - LOSE; - } - - __pthread_spin_unlock (&mutex->__lock); - return 0; - } - - /* The lock is busy. */ - - self = _pthread_self (); - assert (self); - - if (attr == NULL || attr->__mutex_type == PTHREAD_MUTEX_NORMAL) - { -#if defined(ALWAYS_TRACK_MUTEX_OWNER) - assert (mutex->__owner != self); -#endif - } - else - { - switch (attr->__mutex_type) - { - case PTHREAD_MUTEX_ERRORCHECK: - if (mutex->__owner == self) - { - __pthread_spin_unlock (&mutex->__lock); - return EDEADLK; - } - break; - - case PTHREAD_MUTEX_RECURSIVE: - if (mutex->__owner == self) - { - mutex->__locks++; - __pthread_spin_unlock (&mutex->__lock); - return 0; - } - break; - - default: - LOSE; - } - } - -#if !defined(ALWAYS_TRACK_MUTEX_OWNER) - if (attr != NULL && attr->__mutex_type != PTHREAD_MUTEX_NORMAL) -#endif - assert (mutex->__owner); - - if (abstime != NULL && ! valid_nanoseconds (abstime->tv_nsec)) - return EINVAL; - - /* Add ourselves to the queue. */ - __pthread_enqueue (&mutex->__queue, self); - __pthread_spin_unlock (&mutex->__lock); - - /* Block the thread. */ - if (abstime != NULL) - err = __pthread_timedblock (self, abstime, CLOCK_REALTIME); - else - { - err = 0; - __pthread_block (self); - } - - __pthread_spin_lock (&mutex->__lock); - if (self->prevp == NULL) - /* Another thread removed us from the queue, which means a wakeup message - has been sent. It was either consumed while we were blocking, or - queued after we timed out and before we acquired the mutex lock, in - which case the message queue must be drained. */ - drain = err ? 1 : 0; - else - { - /* We're still in the queue. Noone attempted to wake us up, i.e. we - timed out. */ - __pthread_dequeue (self); - drain = 0; - } - __pthread_spin_unlock (&mutex->__lock); - - if (drain) - __pthread_block (self); - - if (err) - { - assert (err == ETIMEDOUT); - return err; - } - -#if !defined(ALWAYS_TRACK_MUTEX_OWNER) - if (attr != NULL && attr->__mutex_type != PTHREAD_MUTEX_NORMAL) -#endif - { - assert (mutex->__owner == self); - } - - if (attr != NULL) - switch (attr->__mutex_type) - { - case PTHREAD_MUTEX_NORMAL: - break; - - case PTHREAD_MUTEX_RECURSIVE: - assert (mutex->__locks == 0); - mutex->__locks = 1; - case PTHREAD_MUTEX_ERRORCHECK: - mutex->__owner = self; - break; - - default: - LOSE; - } - - return 0; -} - -int -__pthread_mutex_timedlock (struct __pthread_mutex *mutex, - const struct timespec *abstime) -{ - return __pthread_mutex_timedlock_internal (mutex, abstime); -} -strong_alias (__pthread_mutex_timedlock, pthread_mutex_timedlock) diff --git a/sysdeps/htl/pt-mutex-transfer-np.c b/sysdeps/htl/pt-mute |
