summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2018-03-19Avoid installing private pthread.hSamuel Thibault
It was actually by mistake that sysdeps/pthread/pthread.h was getting installed and that we'd have an include/pthread/pthread.h. Let's simplify this. * sysdeps/pthread/pthread.h: Move file content to... * ./sysdeps/pthread/pthreadP.h: ... here. * sysdeps/generic/pthread/pthread.h: Move file to... * sysdeps/generic/pthread.h: ... here. * Makefile (headers): Remove pthread/pthread.h. * Makeconfig (includes): Remove -I$(..)htl/include. * pthread/cthreads-compat.c: Include <pthreadP.h> instead of <pthread.h>
2018-03-19Move pthread/pthreadtypes.h to bits/pthreadtypes.hSamuel Thibault
* Makefile (headers): Remove pthread/pthreadtypes.h. * sysdeps/generic/pthread/pthread.h: Include <bits/pthreadtypes.h> instead of <pthread/pthreadtypes.h>. * sysdeps/generic/timer_routines.h: Likewise. * sysdeps/pthread/pthread/pthreadtypes.h: Move file content to... * sysdeps/pthread/bits/pthreadtypes.h: ... this file. Do not include <pthread/pthreadtypes.h>
2018-03-19Remove bits/pt-atomic.hSamuel Thibault
* pthread/pt-create.c: Include <atomic.h> instead of <bits/pt-atomic.h>. (__pthread_total): Change type from __atomic_t to unsigned int. (__pthread_create_internal): Use atomic_increment and atomic_decrement instead of __atomic_inc and __atomic_dec. * pthread/pt-dealloc.c: Include <atomic.h> instead of <bits/pt-atomic.h>. (__pthread_dealloc): Use atomic_decrement_and_test instead of __atomic_dec_and_test. * pthread/pt-exit.c: Include <atomic.h> instead of <bits/pt-atomic.h>. (__pthread_exit): Use atomic_decrement_and_test instead of __atomic_dec_and_test. * pthread/pt-internal.h: Include <atomic.h> instead of <bits/pt-atomic.h>. (struct __pthread): Use unsigned int type for nr_refs field instead of __atomic_t. (__pthread_total): Use unsigned int type instead of nr_refs.
2018-03-19Remove bits/memory.hSamuel Thibault
* sysdeps/generic/pt-once.c: Include <atomic.h> instead of <bits/memory.h> (__pthread_once): Use atomic_full_barrier instead of __memory_barrier. * sysdeps/i386/bits/memory.h: Remove file.
2018-03-18Remove now-useless fileSamuel Thibault
* not-in-libc.h: Remove file.
2018-03-18Use sched_param for nowSamuel Thibault
This exposes more structure names than desired, but we can see how to fix that another way later. * sysdeps/pthread/bits/thread-attr.h (__need_schedparam): Do not define macro. (struct __pthread_attr): Make __schedparam field struct sched_param instead of struct __sched_param. * sysdeps/generic/pt-attr.c (__pthread_default_attr): Use sched_priority instead of __sched_priority. * sysdeps/generic/pt-getschedparam.c (__pthread_getschedparam): Likewise. * sysdeps/generic/timer_routines.h (thread_attr_compare): Likewise.
2018-03-18Remove __need_pthread_mutex / __pthread_mutex_definedSamuel Thibault
We do not actually use them. * sysdeps/mach/hurd/bits/mutex.h: Always include content. * sysdeps/pthread/bits/mutex.h: Always include content.
2018-03-18Fix getting typesSamuel Thibault
* pthread/pt-internal.h: Include <bits/types/res_state.h> instead of defining __need_res_state and including <resolv.h>. * sysdeps/pthread/semaphore.h [__USE_XOPEN2K]: Include <bits/types/struct_timespec.h> instead of defining __need_timespec and including <time.h>.
2018-03-18Remove unused __pthread_init hookSamuel Thibault
Since nothing uses it we get link failures. * pthread/pt-initialize.c (__pthread_init): Remove hook. (___pthread_init): Do not call __pthread_init hook.
2018-03-03Fix copyright years and addressesAmos Jeffries
* sysdeps/mach/hurd/bits/mutex.h: reformat copyright blurb intro to match other files * replace Free Software Foundation address using gnu.org URL from upstream glibc copyright blurbs. * apply upstream glibc scripts/update-copyrights * update copyright date syntax per upstream glibc request
2018-03-03Increase default thread stack to 8MiBSamuel Thibault
Linux' default is 8MiB and applications sometimes assume as much. * sysdeps/mach/hurd/pt-sysdep.h (PTHREAD_STACK_DEFAULT): Set macro to 8MiB.
2018-02-27Drop non-glibc build systemSamuel Thibault
* Makefile: Do not define IN_GLIBC. (elf): Do not define. [IN_GLIBC == no]: Remove support.
2018-02-27Drop deprecated glibc optionSamuel Thibault
* lockfile.c: Do not use _STDIO_USES_IOSTREAM condition any more.
2018-02-24Fix pthread_mutex_trylock return valueSamuel Thibault
* sysdeps/mach/hurd/pt-mutex-trylock.c (__pthread_mutex_trylock): Return EBUSY on failure instead of -1.
2018-02-18Add thread_attr_compare helper functionSamuel Thibault
* sysdeps/generic/timer_routines.h: New file.
2018-01-28Fix versions of forward symbolsSamuel Thibault
* Versions (pthread_attr_destroy, pthread_attr_getdetachstate, pthread_attr_getinheritsched, pthread_attr_getschedparam, pthread_attr_getschedpolicy, pthread_attr_getscope, pthread_attr_init, pthread_attr_setdetachstate, pthread_attr_setinheritsched, pthread_attr_setschedparam, pthread_attr_setschedpolicy, pthread_attr_setscope, pthread_condattr_destroy, pthread_condattr_init, pthread_cond_broadcast, pthread_cond_destroy, pthread_cond_init, pthread_cond_signal, pthread_cond_wait, pthread_cond_timedwait, pthread_equal, pthread_exit, pthread_getschedparam, pthread_setschedparam, pthread_mutex_destroy, pthread_mutex_init, pthread_mutex_lock, pthread_mutex_trylock, pthread_mutex_unlock, pthread_self, pthread_setcancelstate, pthread_setcanceltype, __pthread_get_cleanup_stack): Move to GLIBC_2.21.
2018-01-28Fix version of pthread_hurd_cond_*wait_npSamuel Thibault
* Versions (pthread_hurd_cond_timedwait_np, pthread_hurd_cond_wait_np): Move to GLIBC_2.21.
2018-01-28Remove useless fileSamuel Thibault
* tests/.cvsignore: Remove file.
2018-01-27Fix duplicate definition of LIBPTHREAD_VERSIONSamuel Thibault
Now that libpthread is built along glibc, it should follow that versioning anyway. * Makefile (pthread-version): Do not define. * sysdeps/pthread/Makefile [$(subdir) == posix] (CFLAGS-confstr.c): Set -DLIBPTHREAD_VERSION='"HTL $(version)"'.
2018-01-27Use pthread_key for libc_keySamuel Thibault
* sysdeps/pthread/pthread-functions.h (struct pthread_functions): Rename ptr_pthread_key_create, ptr_pthread_getspecific, ptr_pthread_setspecific fields into ptr___pthread_key_create, ptr___pthread_getspecific, ptr___pthread_setspecific * pthread/pt-initialize.c (struct pthread_functions): Likewise. * sysdeps/pthread/libc-lockP.h (__libc_key_t): Define type. [IS_IN (libpthread)] (PTFAVAIL, __libc_ptf_call, __libc_ptf_call_always): Directly call pthread functions. (__libc_key_create): Define macro to calling __pthread_key_create. (__libc_getspecific): Define macro to calling __pthread_getspecific. (__libc_setspecific): Define macro to calling __pthread_setspecific.
2018-01-27Use libc lock instead of cthreads lock for atfork_lockSamuel Thibault
* forward.c: Include <libc-lock.h> (atfork_lock): Use libc_lock instead of struct mutex. (atfork_pthread_prepare, atfork_pthread_parent, atfork_pthread_child, __register_atfork, __unregister_atfork): Use __libc_lock_lock/unlock instead of __mutex_lock/unlock.
2018-01-27Fix warningSamuel Thibault
* sysdeps/pthread/flockfile.c: Do not include <libio.h> * sysdeps/pthread/funlockfile.c: Likewise.
2018-01-27Fix warningSamuel Thibault
* sysdeps/mach/hurd/pt-sigstate-init.c: Include <hurd/signal.h>
2018-01-27Add missing prototypesSamuel Thibault
* sysdeps/generic/pthread/pthread.h (pthread_mutexattr_getrobust, pthread_mutexattr_getrobust_np, pthread_mutexattr_setrobust, pthread_mutexattr_setrobust_np, pthread_rwlockattr_getkind_np, pthread_rwlockattr_setkind_np): Add prototypes.
2018-01-26Simplify making libpthread link against libmachuserSamuel Thibault
* Makefile ($(objpfx)libpthread.so): Drop specific rule.
2018-01-25Fix spurious whitespacesSamuel Thibault
2018-01-25Complete htl subdir switchSamuel Thibault
* Makeconfig (shared-thread-library, static-thread-library, rpath-dirs, includes): Fix patch from libpthread/ to htl/. * Makefile (extra-B-pthread.so): Likewise.
2018-01-25Switch subdir to htlSamuel Thibault
As agreed with glibc upstream. * Makefile [IN_GLIBC] (subdir): Set to htl.
2018-01-21Versions: Add missing symbol export from libcSamuel Thibault
* sysdeps/pthread/Versions (__mach_port_allocate): Add symbol.
2018-01-21Move Version to sysdeps so the normal sysdeps mechanism worksSamuel Thibault
to cope with the removal of add-ons mechanism. * pthread/Versions: Move to sysdeps/pthread/.
2018-01-06Remove use of `internal_function'Samuel Thibault
Following 100a2df1686521605a784062ccda6a6b30c62deb. * libc_pthread_init.c (__libc_pthread_init): Do not qualify with internal_function.
2018-01-06Move headers to sysdeps so the normal sysdeps mechanism worksSamuel Thibault
to cope with the removal of add-ons mechanism. * include/pthread/pthread.h: rename to sysdeps/generic/pthread/pthread.h * include/pthread/pthreadtypes.h: rename to sysdeps/generic/pthread/pthreadtypes.h * pthreadP.h: rename to sysdeps/pthread/pthreadP.h
2018-01-06Remove use of `internal_function'Samuel Thibault
Recent glibc does not define it any more. * sysdeps/pthread/pthread-functions.h (__libc_pthread_init): Do not qualify with internal_function.
2018-01-06Move key management to sysdeps/genericSamuel Thibault
Now that it does not use libihash any more, it is not hurd-dependent any more. * sysdeps/hurd/pt-destroy-specific.c: Move to sysdeps/generic/pt-destroy-specific.c * sysdeps/hurd/pt-key-create.c: Move to sysdeps/generic/pt-key-create.c. * sysdeps/hurd/pt-key-delete.c: Move to sysdeps/generic/pt-key-delete.c. * sysdeps/hurd/pt-key.h: Move to sysdeps/generic/pt-key.h. * sysdeps/hurd/pt-getspecific.c: Move to sysdeps/generic/pt-getspecific.c. * sysdeps/hurd/pt-init-specific.c: Move to sysdeps/generic/pt-init-specific.c. * sysdeps/hurd/pt-setspecific.c: Move to sysdeps/generic/pt-setspecific.c.
2017-12-27Make pthread_mutex use gsyncAgustina Arzille
* Makefile (libpthread-routines): Add pt-mutexattr-getrobust pt-mutexattr-setrobust pt-mutex-consistent. * include/pthread/pthreadtypes.h (__pthread_mutex_robustness): New enum, containing __PTHREAD_MUTEX_STALLED, __PTHREAD_MUTEX_ROBUST. * include/pthread/pthread.h [__USE_XOPEN2K] (PTHREAD_MUTEX_STALLED, PTHREAD_MUTEX_ROBUST): New macros. [__USE_XOPEN2K8] (pthread_mutex_consistent, pthread_mutex_consistent_np): New declarations. * sysdeps/mach/hurd/bits/mutex.h sysdeps/mach/hurd/pt-mutex-consistent.c sysdeps/mach/hurd/pt-mutex-destroy.c sysdeps/mach/hurd/pt-mutex-getprioceiling.c sysdeps/mach/hurd/pt-mutex-init.c sysdeps/mach/hurd/pt-mutex-lock.c sysdeps/mach/hurd/pt-mutex-setprioceiling.c sysdeps/mach/hurd/pt-mutex-timedlock.c sysdeps/mach/hurd/pt-mutex-transfer-np.c sysdeps/mach/hurd/pt-mutex-trylock.c sysdeps/mach/hurd/pt-mutex-unlock.c sysdeps/mach/hurd/pt-mutex.h sysdeps/mach/hurd/pt-mutexattr-destroy.c sysdeps/mach/hurd/pt-mutexattr-getprioceiling.c sysdeps/mach/hurd/pt-mutexattr-getprotocol.c sysdeps/mach/hurd/pt-mutexattr-getpshared.c sysdeps/mach/hurd/pt-mutexattr-getrobust.c sysdeps/mach/hurd/pt-mutexattr-gettype.c sysdeps/mach/hurd/pt-mutexattr-init.c sysdeps/mach/hurd/pt-mutexattr-setprioceiling.c sysdeps/mach/hurd/pt-mutexattr-setprotocol.c sysdeps/mach/hurd/pt-mutexattr-setpshared.c sysdeps/mach/hurd/pt-mutexattr-setrobust.c sysdeps/mach/hurd/pt-mutexattr-settype.c sysdeps/mach/hurd/pt-mutexattr.c: New files
2017-11-05Make pthread_spinlock use gsyncAgustina Arzille
* pthread/pt-spin-inlines.c (pthread_spin_lock): Define weak alias for __pthread_spin_lock. * sysdeps/mach/bits/spin-lock-inline.h: Include <lock-intern.h> instead of <machine-lock.h>. (__pthread_spin_trylock, __pthread_spin_unlock): Use __spin_lock_t type instead of __lock. (__pthread_spin_lock): Define as inline only, use __spin_lock and __spin_lock_t type. * sysdeps/mach/bits/spin-lock.h: Do not include <machine-lock.h> (__pthread_spinlock_t): Use volatile int instead of __spin_lock_t. (__PTHREAD_SPIN_LOCK_INITIALIZER): Define to 0. * sysdeps/mach/i386/bits/spin-lock-inline.h: Remove file. * sysdeps/mach/i386/bits/spin-lock.h: Remove file. * sysdeps/posix/pt-spin.c (pthread_spin_lock, __pthread_spin_lock): Remove weak aliases, provided by pt-spin-inlines.c
2017-11-05Install missing headersSamuel Thibault
* Makefile (headers): Add bits/pthreadtypes-arch.h and bits/thread-shared-types.h.
2017-11-05Add missing internal namesSamuel Thibault
Follow-up 2b7d0800f314e0abf370b2b6f6272a2ddb875464 ('Fix exposing symbols') * sysdeps/generic/pt-mutexattr-destroy.c (__pthread_mutexattr_destroy): Define. (pthread_mutexattr_destroy): Redefine as alias. * sysdeps/generic/pt-mutexattr-init.c (__pthread_mutexattr_init): Define. (pthread_mutexattr_init): Redefine as alias. * sysdeps/generic/pt-mutexattr-settype.c (__pthread_mutexattr_settype): Define. (pthread_mutexattr_settype): Redefine as alias.
2017-09-26Avoid exposing mach_port_set_qlimitSamuel Thibault
* sysdeps/mach/pt-thread-alloc.c (create_wakeupmsg): Call __mach_port_set_qlimit instead of mach_port_set_qlimit.
2017-09-26Remove libihash useSamuel Thibault
It poses compilation bootstrapping inconvenience, non-standard symbol exposition, and this is overkill, considering the usual use of TSD, and the availability of TLS. * sysdeps/hurd/pt-key.h: Do not include <hurd/ihash.h>. (PTHREAD_KEY_MEMBERS): Turn thread_specifics to a void**, add unsigned thread_specifics_size. * sysdeps/hurd/pt-init-specific.c (__pthread_init_specific): Initialize thread_specifics_size to 0. * sysdeps/hurd/pt-setspecific.c: Do not include <hurd/ihash.h>. (__pthread_setspecific): Expand and access thread_specifics array instead of hash table. * sysdeps/hurd/pt-getspecific.c: Do not include <hurd/ihash.h>. (__pthread_getspecific): Access thread_specifics array instead of hash table. * sysdeps/hurd/pt-key-delete.c (pthread_key_delete): Clean thread_specifics array instead of hash table. * sysdeps/hurd/pt-destroy-specific.c: Do not include <hurd/ihash.h>. (__pthread_destroy_specific): Clean and free thread_specifics array instead of hash table. * Makeconfig (LDLIBS-tst-interpose-static-thread): Remove -lihash. (LDLIBS-tst-linkall-static): Remove -lihash. * Makefile (HURDLIBS): Remove ihash. (LDLIBS-pthread.so): Remove -lihash. * libpthread.a: Remove -lihash. * libpthread_pic.a: Remove -lihash_pic.
2017-09-25Fix symbol expositionSamuel Thibault
* sysdeps/generic/pt-rwlock-rdlock.c (pthread_rwlock_rdlock): Make alias weak. * sysdeps/generic/pt-rwlock-unlock.c (pthread_rwlock_unlock): Likewise. * sysdeps/generic/pt-rwlock-wrlock.c (pthread_rwlock_wrlock): Likewise. * sysdeps/generic/sem-timedwait.c (sem_timedwait): Likewise. * sysdeps/generic/pt-rwlock-timedrdlock.c (pthread_rwlock_timedrdlock): Make it a weak alias. * sysdeps/generic/pt-rwlock-timedwrlock.c (pthread_rwlock_timedwrlock): Likewise.
2017-09-25Fix exposing symbolsSamuel Thibault
* sysdeps/hurd/pt-key.h (__pthread_key_lock_ready): Use __pthread_mutexattr_init, __pthread_mutexattr_settype, _pthread_mutex_init, __pthread_mutexattr_destroy, __pthread_once instead of pthread_mutexattr_init, pthread_mutexattr_settype,pthread_mutex_init, pthread_mutexattr_destroy, pthread_once.
2017-09-24Fix symbols exposed in linkspaceSamuel Thibault
Libc uses some thread functions, but should not expose the corresponding symbols, so use aliases. * Versions (__cthread_detach, __cthread_fork, __cthread_keycreate, __cthread_getspecific, __cthread_setspecific, __pthread_getattr_np, __pthread_attr_getstack): Add symbols * pthread/cthreads-compat.c (cthread_t, cthread_fn_t, cthread_key_t): Do not define. (cthread_detach): Rename to __cthread_detach. (cthread_detach): Define as weak alias to __cthread_detach. (cthread_fork, cthread_keycreate, cthread_getspecific, cthread_setspecific): Likewise. * pthread/pt-getattr.c (pthread_getattr_np): Likewise. * sysdeps/generic/pt-attr-getstack.c (pthread_attr_getstack): Likewise. * sysdeps/pthread/pthread.h (__cthread_t, __cthread_key_t, __cthread_fn_t, __cthread_fork, __cthread_detach, __cthread_keycreate, __cthread_getspecific, __cthread_setspecific, __pthread_getattr_np, __pthread_attr_getstack): Declare.
2017-09-17Fix build with hidden symbolsSamuel Thibault
* forward.c (__register_atfork): Add missing def for hidden symbol.
2017-09-03Add headers wanted by glibc 2.26Samuel Thibault
* sysdeps/i386/bits/pthreadtypes-arch.h: New file. * sysdeps/pthread/bits/thread-shared-types.h: New file. * sysdeps/pthread/bits/pthreadtypes.h: Include <thread-shared-types.h>
2017-09-03Fix build with glibc 2.26Samuel Thibault
* sysdeps/generic/pt-attr.c (__pthread_default_attr.__schedparam): Use __sched_priority field name instead of sched_priority.
2017-08-28Implement basic pthread_getschedparamSamuel Thibault
* sysdeps/generic/pt-getschedparam.c (__pthread_getschedparam): Return SCHED_OTHER and priority 0. Remove stub warning.
2017-08-03Move pthread.h to where glibc will find itSamuel Thibault
* include/pthread.h: Move to... * sysdeps/pthread/pthread.h: ... here.
2017-08-03Fix linking glibc 2.25 testsSamuel Thibault
* Makeconfig [($(subdir) == malloc] (LDLIBS-tst-interpose-static-thread): Add -lihash. [($(subdir) == elf] (LDLIBS-tst-linkall-static): Add -lihash.
2017-08-03Revert "Make statically linking libpthread pull libihash"Samuel Thibault
This reverts commit d3b47d4482e0c8372f51472d9d075a89759919ea. The variable is actually used for dependencies as well.