summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2012-08-30Merge commit 'refs/top-bases/t/fix_have_kernel_resources' into ↵t/fix_have_kernel_resourcesThomas Schwinge
t/fix_have_kernel_resources
2012-08-30Merge commit 'refs/top-bases/baseline' into baselinebaselineThomas Schwinge
2012-08-30Advance.Thomas Schwinge
2012-08-30Base on baseline.Thomas Schwinge
2012-08-30Initialize.Thomas Schwinge
2012-08-07tests/Makefile: Support INSTALL_ROOT environment variable.Thomas Schwinge
* tests/Makefile [ifdef INSTALL_ROOT] (INSTALL_ROOT_CPPFLAGS) (INSTALL_ROOT_LDFLAGS): New variables. (%.o: %.c, %: %.o): New rules. (%-static: %.o): Update rule. * tests/README: Update.
2012-08-07Rename ia32 sysdep directories to i386.Thomas Schwinge
* sysdeps/i386/Implies: Remove file. * sysdeps/mach/hurd/i386/Implies: Likewise. * sysdeps/ia32/bits/memory.h: Rename to sysdeps/i386/bits/memory.h. * sysdeps/ia32/bits/pt-atomic.h: Rename to sysdeps/i386/bits/pt-atomic.h. * sysdeps/ia32/bits/spin-lock-inline.h: Rename to sysdeps/i386/bits/spin-lock-inline.h. * sysdeps/ia32/bits/spin-lock.h: Rename to sysdeps/i386/bits/spin-lock.h. * sysdeps/ia32/machine-sp.h: Rename to sysdeps/i386/machine-sp.h. * sysdeps/ia32/pt-machdep.h: Rename to sysdeps/i386/pt-machdep.h. * sysdeps/mach/hurd/ia32/pt-machdep.c: Rename to sysdeps/mach/hurd/i386/pt-machdep.c. * sysdeps/mach/hurd/ia32/pt-setup.c: Rename to sysdeps/mach/hurd/i386/pt-setup.c. * Makefile (SYSDEP_PATH): Adapt to that.
2012-08-07Remove PowerPC port.Thomas Schwinge
* sysdeps/powerpc/bits/machine-lock.h: Remove file. * sysdeps/powerpc/bits/memory.h: Likewise. * sysdeps/powerpc/bits/spin-lock.h: Likewise. * sysdeps/powerpc/machine-sp.h: Likewise. * sysdeps/powerpc/pt-machdep.h: Likewise. * TODO: Update.
2012-08-07* signal/README: Add note about accompanying sysdeps/generic/ files.Thomas Schwinge
2012-08-07Remove L4 port.Thomas Schwinge
* Makefile.am: Remove file. * headers.m4: Likewise. * sysdeps/l4/bits/pthread-np.h: Likewise. * sysdeps/l4/hurd/bits/pthread-np.h: Likewise. * sysdeps/l4/hurd/ia32/pt-machdep.c: Likewise. * sysdeps/l4/hurd/ia32/pt-setup.c: Likewise. * sysdeps/l4/hurd/ia32/signal-dispatch-lowlevel.c: Likewise. * sysdeps/l4/hurd/powerpc/pt-machdep.c: Likewise. * sysdeps/l4/hurd/powerpc/pt-setup.c: Likewise. * sysdeps/l4/hurd/pt-block.c: Likewise. * sysdeps/l4/hurd/pt-kill.c: Likewise. * sysdeps/l4/hurd/pt-setactivity-np.c: Likewise. * sysdeps/l4/hurd/pt-sigstate-destroy.c: Likewise. * sysdeps/l4/hurd/pt-sigstate-init.c: Likewise. * sysdeps/l4/hurd/pt-sigstate.c: Likewise. * sysdeps/l4/hurd/pt-startup.c: Likewise. * sysdeps/l4/hurd/pt-sysdep.c: Likewise. * sysdeps/l4/hurd/pt-sysdep.h: Likewise. * sysdeps/l4/hurd/pt-thread-alloc.c: Likewise. * sysdeps/l4/hurd/pt-thread-halt.c: Likewise. * sysdeps/l4/hurd/pt-thread-start.c: Likewise. * sysdeps/l4/hurd/pt-wakeup.c: Likewise. * sysdeps/l4/hurd/sig-sysdep.h: Likewise. * sysdeps/l4/hurd/sigprocmask.c: Likewise. * sysdeps/l4/pt-block.c: Likewise. * sysdeps/l4/pt-docancel.c: Likewise. * sysdeps/l4/pt-pool-np.c: Likewise. * sysdeps/l4/pt-spin.c: Likewise. * sysdeps/l4/pt-stack-alloc.c: Likewise. * sysdeps/l4/pt-thread-alloc.c: Likewise. * sysdeps/l4/pt-thread-dealloc.c: Likewise. * sysdeps/l4/pt-thread-halt.c: Likewise. * sysdeps/l4/pt-thread-start.c: Likewise. * sysdeps/l4/pt-timedblock.c: Likewise. * sysdeps/l4/pt-wakeup.c: Likewise. * TODO: Update. * signal/README: Likewise.
2012-08-07Fix libpthread.so symlinkSamuel Thibault
* Makefile ($(inst_libdir)/libpthread.so): Symlink from absolute path $(slibdir)/libpthread.so$(libpthread.so-version) instead of relative, as both files may not be in the same directory (e.g. in Debian).
2012-08-04Fix typoThomas DiModica
* Makefile (inst_libdir) [!IN_GLIBC]: Set variable to $(libdir) instead of expanding it.
2012-07-08Default to a little guardsizeSamuel Thibault
Later rounded up to a page. * sysdeps/generic/pt-attr.c (__pthread_default_attr) [!PAGESIZE]: Set guardsize field to 1.
2012-07-08Comment on deviation from standardSamuel Thibault
* pthread/pt-internal.h (guardsize): Mention that we depart from the standard which says guardsize is in addition to stacksize.
2012-05-25Merge branch 'master' of git.savannah.gnu.org:/srv/git/hurd/libpthreadSamuel Thibault
2012-05-25Add -lrt to libpthread.a to fix static linkSamuel Thibault
* libpthread.a (GROUP): Add -lrt.
2012-04-27Store self in __thread variable instead of threadvarSamuel Thibault
* sysdeps/mach/hurd/pt-sysdep.h (_HURD_THREADVAR_THREAD): Remove macro. (___pthread_self): Declare new __thread variable. (_pthread_self): Take self pointer from ___pthread_self instead of threadvar. * sysdeps/mach/hurd/pt-sysdep.c (___pthread_self): Define new __thread variable. (init_routine): Set ___pthread_self to initial thread structure. * pthread/pt-internal.h (__pthread_setup): Add `self' parameter to `entry_point' parameter. * pthread/pt-create.c (entry_point): Add `self' parameter. Store it in ___pthread_self. * sysdeps/l4/hurd/ia32/pt-setup.c (stack_setup): Add `self parameter to `entry_point' parameter. Pass it the `thread' parameter. (__pthread_setup): Likewise. * sysdeps/l4/hurd/powerpc/pt-setup.c (struct start_info): Add `self' field. (first_entry_1): Pass `self' parameter. (stack_setup): Add `self' parameter to `entry_point' parameter, pass it the `thread' parameter. (__pthread_setup): Likewise. * sysdeps/mach/hurd/ia32/pt-setup.c (stack_setup): Pass `thread' parameter to the start routine. (stack_setup): Add `self' parameter to `entry_point' paramter.
2012-04-27Always pass the pthread_functions structureSamuel Thibault
* pthread/pt-initialize.c (pthread_functions): Always define. (__pthread_init): Always pass address of pthread_functions.
2012-04-23Rename __pthread_initialize into __pthread_initSamuel Thibault
The former conflicts with usage in glibc. * pthread/pt-initialize.c (__pthread_initialize): Rename into __pthread_init. * pthread/pt-internal.h (__pthread_initialize): Likewise. * sysdeps/l4/hurd/pt-sysdep.c (init_routine): Likewise. * sysdeps/mach/hurd/pt-sysdep.c (init_routine): Likewise.
2012-04-23Fix access to libpthread headers from glibcSamuel Thibault
* Makeconfig (+includes): Add our include/ directory in the header include path, for the rest of glibc.
2012-04-22Merge branch 'master' of git.savannah.gnu.org:/srv/git/hurd/libpthreadSamuel Thibault
2012-04-22Fix glibc add-on installation rulesSamuel Thibault
* Makefile [IN_GLIBC=no] (inst_libdir): Define to $(libdir). (install, .PHONY, libpthread2.a, libpthread2_pic.a): Use $(inst_libdir) instead of $(libdir), enable in IN_GLIBC=yes too. [IN_GLIBC=yes] ($(inst_libdir)/libpthread.so): Define to create symlink.
2012-04-22Install bits/pthreadtypes.hSamuel Thibault
And make it expose only types, not the rest of the pthread API. * Makefile (headers): Add bits/pthreadtypes.h. * sysdeps/generic/bits/pthreadtypes.h: Include <pthread/pthreadtypes.h> instead of <pthread.h>
2012-04-22Set -B option to find libpthread.soSamuel Thibault
* Makefile (extra-B-pthread.so): Define.
2012-04-22pthread_condattr_setclock: allow a monotonic clock, if presentPino Toscano
If CLOCK_MONOTONIC is requested, check (only once) for the availability of a monotonic clock using `clock_getres'. If it is not, reject CLOCK_MONOTONIC with EINVAL (as before). * sysdeps/generic/pt-condattr-setclock.c (pthread_condattr_setclock): Check for monotonic clock if requested.
2012-04-22__pthread_timedblock: switch to clock_gettimePino Toscano
Use `clock_gettime' with the provided clock instead of `gettimeofday', linking to rt. * sysdeps/mach/pt-timedblock.c (__pthread_timedblock): Switch to `clock_gettime'. * Makefile [!IN_GLIBC] (LDLIBS): Link to rt. [IN_GLIBC] ($(objpfx)libpthread.so): Likewise. * Makefile.am (libpthread_a_LDADD): Likewise.
2012-04-22__pthread_timedblock: add an argument for the clock idPino Toscano
To make `__pthread_timedblock' properly measure time using the right clock, add a new argument representing the clock to use. * pthread/pt-internal.h (__pthread_timedblock): New argument CLOCK_ID. * sysdeps/l4/pt-timedblock.c (__pthread_timedblock): Likewise. * sysdeps/mach/pt-timedblock.c (__pthread_timedblock): Likewise. * sysdeps/generic/pt-cond-timedwait.c (__pthread_cond_timedwait_internal): Pass the clock of the `pthread_cond' to `__pthread_timedblock'. * sysdeps/generic/pt-mutex-timedlock.c (__pthread_mutex_timedlock_internal): Pass CLOCK_REALTIME to `__pthread_timedblock'. * sysdeps/generic/pt-rwlock-timedrdlock.c (__pthread_rwlock_timedrdlock_internal): Likewise. * sysdeps/generic/pt-rwlock-timedwrlock.c (__pthread_rwlock_timedwrlock_internal): Likewise. * sysdeps/generic/sem-timedwait.c (__sem_timedwait_internal): Likewise.
2012-04-21Add glibc build supportSamuel Thibault
* Makeconfig, Versions, configure.in, forward.c, libc_pthread_init.c, pthread/pthread-functions.h, shlib-versions, sysdeps/i386/Implies, sysdeps/mach/hurd/Implies, sysdeps/mach/hurd/i386/Implies: New files. * Makefile: Add glibc rules, enabled when IN_GLIBC is defined to yes, when $(..) is defined. * pthread/pt-initialize.c [IS_IN_libpthread] (pthread_functions): New variable. [IS_IN_libpthread] (__pthread_initialize): Call __libc_pthread_init.
2012-04-21Do not redefine tcbhead_t in glibcSamuel Thibault
* pthread/pt-internal.h (tcbhead_t): Define struct only if IS_IN_libpthread is not defined.
2012-04-21Rename bits/atomic.h to bits/pt-atomic.hSamuel Thibault
This avoids a conflict with glibc-provided bits/atomic.h * sysdeps/ia32/bits/atomic.h: Rename to... * sysdeps/ia32/bits/pt-atomic.h: ... this. * pthread/pt-create.c: Include <bits/pt-atomic.h> instead of <bits/atomic.h> * pthread/pt-exit.c: Likewise. * pthread/pt-internal.h: Likewise.
2012-04-21Rename pthread functions to be used for forwardingSamuel Thibault
Libc will need to be able to call them, so they need to have a different name. * pthread/pt-exit.c (pthread_exit): Rename with __ prefix and add strong alias. * pthread/pt-self.c (pthread_self): Likewise. * pthread/pt-setcancelstate.c (pthread_setcancelstate): Likewise * pthread/pt-setcanceltype.c (pthread_setcanceltype): Likewise * sysdeps/generic/pt-attr-destroy.c (pthread_attr_destroy): Likewise * sysdeps/generic/pt-attr-getdetachstate.c (pthread_attr_getdetachstate): Likewise * sysdeps/generic/pt-attr-getinheritsched.c (pthread_attr_getinheritsched): Likewise * sysdeps/generic/pt-attr-getschedparam.c (pthread_attr_getschedparam): Likewise * sysdeps/generic/pt-attr-getschedpolicy.c (pthread_attr_getschedpolicy): Likewise * sysdeps/generic/pt-attr-getscope.c (pthread_attr_getscope): Likewise * sysdeps/generic/pt-attr-init.c (pthread_attr_init): Likewise * sysdeps/generic/pt-attr-setdetachstate.c (pthread_attr_setdetachstate): Likewise * sysdeps/generic/pt-attr-setinheritsched.c (pthread_attr_setinheritsched): Likewise * sysdeps/generic/pt-attr-setschedparam.c (pthread_attr_setschedparam): Likewise * sysdeps/generic/pt-attr-setschedpolicy.c (pthread_attr_setschedpolicy): Likewise * sysdeps/generic/pt-attr-setscope.c (pthread_attr_setscope): Likewise * sysdeps/generic/pt-cond-brdcast.c (pthread_cond_broadcast): Likewise * sysdeps/generic/pt-cond-destroy.c (pthread_cond_destroy): Likewise * sysdeps/generic/pt-cond-init.c (pthread_cond_init): Likewise * sysdeps/generic/pt-cond-signal.c (pthread_cond_signal): Likewise * sysdeps/generic/pt-cond-timedwait.c (pthread_cond_timedwait): Likewise * sysdeps/generic/pt-cond-wait.c (pthread_cond_wait): Likewise * sysdeps/generic/pt-condattr-destroy.c (pthread_condattr_destroy): Likewise * sysdeps/generic/pt-condattr-init.c (pthread_condattr_init): Likewise * sysdeps/generic/pt-equal.c (pthread_equal): Likewise * sysdeps/generic/pt-getschedparam.c (pthread_getschedparam): Likewise * sysdeps/generic/pt-setschedparam.c (pthread_setschedparam): Likewise
2011-11-27Fix __mutex_unlock_solid safetySamuel Thibault
libc releases the spinlock before calling __mutex_unlock_solid, so we have to try to reacquire it before possibly giving it to some blocked thread. * pthread/cthreads-compat.c (__mutex_unlock_solid): Call __pthread_spin_trylock before calling __pthread_mutex_unlock.
2011-11-07Add XOpen 2008 visibilitySamuel Thibault
* include/pthread/pthread.h [__USE_XOPEN2K8] (PTHREAD_MUTEX_NORMAL, PTHREAD_MUTEX_ERRORCHECK, PTHREAD_MUTEX_RECURSIVE, PTHREAD_MUTEX_DEFAULT, pthread_mutexattr_gettype, pthread_mutexattr_settype): Expose.
2011-11-06Merge branch 'master' of git.savannah.gnu.org:/srv/git/hurd/libpthreadSamuel Thibault
2011-11-06pthread_getspecific, pthread_setspecific: check the key validityPino Toscano
When getting a TSD, handle gracefully the case of an invalid key. When setting a TSD, check for the validity of the key as recommended (although not required) by POSIX. This also avoids potentially filling the `thread_specifics' hash of threads with TSD of invalid keys. Add two simple checks in test-7.c for the two situations above. * sysdeps/hurd/pt-getspecific.c (pthread_getspecific): Check the validity of the specified key. * sysdeps/hurd/pt-setspecific.c (pthread_setspecific): Likewise. * tests/test-7.c (main): Add two assertions.
2011-11-06Merge branch '__pthread_destroy_specific-PTHREAD_KEY_INVALID'Thomas Schwinge
Conflicts: tests/Makefile
2011-11-05Correct logic for PTHREAD_KEY_INVALID slots.Thomas Schwinge
* sysdeps/hurd/pt-destroy-specific.c (__pthread_destroy_specific): Correct logic for PTHREAD_KEY_INVALID slots. * tests/test-__pthread_destroy_specific-skip.c: New file. * tests/Makefile (CHECK_SRC): Add test-__pthread_destroy_specific-skip.c.
2011-11-05Remove all the values when deleting a keyPino Toscano
When deleting a key using `pthread_key_delete', delete all the values associated to that key in all the threads available. Otherwise, the key reuse in `pthread_key_create' can cause new keys to have thread specific data of the previously used key with the same index. Add a test for this case, which creates and deletes pairs of keys checking that they have a NULL thread specific data after creation. * sysdeps/hurd/pt-key-delete.c (pthread_key_delete): Remove all the values of the key in all the threads. * tests/Makefile (CHECK_SRC): Add test-17.c. * tests/test-17.c: New file.
2011-10-20Merge commit 'refs/top-bases/t/fix_have_kernel_resources' into ↵Thomas Schwinge
t/fix_have_kernel_resources
2011-10-20Merge branch 'tls'Thomas Schwinge
Conflicts: ChangeLog Makefile pthread/pt-exit.c pthread/pt-internal.h sysdeps/mach/hurd/ia32/pt-setup.c sysdeps/mach/hurd/pt-docancel.c sysdeps/mach/hurd/pt-sysdep.h
2011-10-20 TLS support for libpthread, Mach/Hurd (x86).Samuel Thibault
* Makefile (CFLAGS): Define ENABLE_TLS. * pthread/pt-create.c (__pthread_create_internal) [ENABLE_TLS]: Call into glibc to allocate static TLS block. * pthread/pt-exit.c (pthread_exit) [ENABLE_TLS]: Call into glibc to deallocate static TLS block. * pthread/pt-internal.h [ENABLE_TLS] (tcbhead_t): New structure; as in glibc. (__pthread) [ENABLE_TLS]: Add TCB member. [ENABLE_TLS] (_dl_allocate_tls, _dl_deallocate_tls): Declare; from glibc. * sysdeps/mach/hurd/pt-sysdep.h (__thread_set_pcsp): Rename to __thread_set_pcsptp. Add SET_TP and TP parameters. Change all callers. * sysdeps/mach/hurd/i386/pt-machdep.c (__thread_set_pcsptp): Imlement TLS support. * sysdeps/mach/hurd/i386/pt-setup.c (__pthread_setup): Likewise.
2011-09-15Merge commit 'refs/top-bases/t/fix_have_kernel_resources' into ↵Thomas Schwinge
t/fix_have_kernel_resources
2011-09-15<pthread.h> must pull in a NULL definition.Thomas Schwinge
Thus, revert a bit of commit 769e2108a0f5fc49eff9f3addbaf5f0646bcb253. * pthread/cthreads-compat.c: Don't #include <stddef.h>.
2011-09-15Merge branch 'master' of git.savannah.gnu.org:/srv/git/hurd/libpthreadSamuel Thibault
2011-09-15Make pthread.h include time.hSamuel Thibault
As required by posix. * include/pthread/pthread.h: Include <time.h>
2011-09-07Merge commit 'refs/top-bases/t/fix_have_kernel_resources' into ↵Thomas Schwinge
t/fix_have_kernel_resources
2011-09-07Tiny build and GCC warning fixes.Thomas Schwinge
* pthread/cthreads-compat.c: #include <stddef.h> for NULL. * pthread/pt-exit.c (pthread_exit): Remove stray need_dealloc variable. * sysdeps/generic/pt-attr-getschedparam.c: #include <string.h> for memcpy. * sysdeps/mach/hurd/ia32/pt-setup.c (stack_setup): Apply some more typecasting. * tests/test-1.c: #include <assert.h>. * tests/test-6.c: Likewise. * tests/test-7.c: Likewise. * tests/test-16.c (handler): Take parameters for sa_handler, not sa_sigaction.
2011-09-07Merge commit 'refs/top-bases/t/fix_have_kernel_resources' into ↵Thomas Schwinge
t/fix_have_kernel_resources
2011-08-23Use __clockid_t instead of clockid_tSamuel Thibault
Using clockid_t just for pthread types makes us pull <time.h>, which defines time(), which may conflict with applications. * include/pthread/pthread.h (pthread_condattr_getclock, pthread_condattr_setclock, pthread_getcpuclockid): Use __clockid_t instead of clockid_t. * include/pthread/pthreadtypes.h: Include <bits/types.h>, instead of <time.h> and defining clockid_t ourself when not defined by time.h. * sysdeps/generic/bits/condition-attr.h: Include <bits/types.h> instead of <time.h>. (__pthread_condattr): Use __clockid_t instead of clockid_t.
2010-09-03Fix __sched_param / sched_param conversionSamuel Thibault
* sysdeps/generic/pt-attr-getschedparam.c (pthread_attr_getschedparam): memcpy from `attr->schedparam' to `param' to convert from __sched_param to sched_param. * sysdeps/generic/pt-attr-setschedparam.c (pthread_attr_setschedparam): memcpy from `param' to `attr->schedparam' to convert from sched_param to __sched_param.