summaryrefslogtreecommitdiff
path: root/sysdeps/generic
AgeCommit message (Collapse)Author
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.
2010-09-02Use __sched_param instead of sched_paramSamuel Thibault
to avoid exposing inclusion of <sched.h> and exposure of sched_param from <sys/types.h> * sysdeps/generic/bits/thread-attr.h: Define __need_schedparam and include <bits/sched.h> instead of including <sched.h> (__pthread_attr): Use `__sched_param' instead of `sched_param'.
2010-09-01Prevent pthread.h from exposing assert()Samuel Thibault
* sysdeps/generic/bits/cancelation.h: Do not include <assert.h> (__pthread_cleanup_pop): Do not call `assert'.
2009-10-13Fix pthread_cleanup_push old-gcc-style initializerSamuel Thibault
sysdeps/generic/bits/cancelation.h (__pthread_cleanup_push): For better portability to various compilation flags, use standard initializer for struct __pthread_cancelation_handler __handler instead of old-gcc-style.
2009-08-23Fix pthread_mutex_t static initializersSamuel Thibault
Fix pthread_mutex_t static initializers by not leaving references to __pthread_recursive_mutexattr. * include/pthread/pthread.h.orig (PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP): New macro. * sysdeps/generic/pt-mutex-destroy.c (_pthread_mutex_destroy): Compare mutex->attr with __PTHREAD_ERRORCHECK_MUTEXATTR and __PTHREAD_RECURSIVE_MUTEXATTR instead of __pthread_recursive_mutexattr. * sysdeps/generic/pt-mutex-init.c (_pthread_mutex_init): Likewise. * sysdeps/generic/pt-mutex-timedlock.c (__pthread_mutex_timedlock_internal): Likewise. * sysdeps/generic/pt-mutex-transfer-np.c (__pthread_mutex_transfer_np): Likewise. * sysdeps/generic/pt-mutex-trylock.c (__pthread_mutex_trylock): Likewise. * sysdeps/generic/pt-mutex-unlock.c (__pthread_mutex_unlock): Likewise. * sysdeps/generic/pt-mutexattr.c (__pthread_errorcheck_mutexattr): New const. * sysdeps/generic/bits/mutex-attr.h (__pthread_errorcheck_mutexattr): Declare const. * sysdeps/generic/bits/mutex.h (__PTHREAD_ERRORCHECK_MUTEXATTR, __PTHREAD_ERRORCHECK_MUTEX_INITIALIZER, __PTHREAD_RECURSIVE_MUTEXATTR): New macros. (__PTHREAD_RECURSIVE_MUTEX_INITIALIZER): Use __PTHREAD_RECURSIVE_MUTEXATTR macro instead of &__pthread_recursive_mutexattr.
2009-08-23Fix assertion failure in pthread_mutex_trylockSamuel Thibault
* sysdeps/generic/pt-mutex-trylock.c [!ALWAYS_TRACK_MUTEX_OWNER] (__pthread_mutex_trylock): Disable owner tracking.
2009-04-082009-01-10 Samuel Thibault <samuel.thibault@ens-lyon.org>Samuel Thibault
* sysdeps/i386/bits/spin-lock.h (__SPIN_LOCK_INITIALIZER): Rename macro to... (__PTHREAD_SPIN_LOCK_INITIALIZER): ... this. * sysdeps/mach/bits/spin-lock.h (__SPIN_LOCK_INITIALIZER): Rename macro to... (__PTHREAD_SPIN_LOCK_INITIALIZER): ... this. * include/pthread/pthread.h (PTHREAD_SPINLOCK_INITIALIZER): Use __PTHREAD_SPIN_LOCK_INITIALIZER instead of __SPIN_LOCK_INITIALIZER. * sysdeps/generic/bits/condition.h (__PTHREAD_COND_INITIALIZER): Likewise. * sysdeps/generic/bits/mutex.h (__PTHREAD_MUTEX_INITIALIZER, __PTHREAD_RECURSIVE_MUTEX_INITIALIZER): Likewise. * sysdeps/generic/bits/once.h (__PTHREAD_ONCE_INIT): Likewise. * sysdeps/generic/bits/rwlock.h (__PTHREAD_RWLOCK_INITIALIZER): Likewise. * sysdeps/generic/bits/semaphore.h (__SEMAPHORE_INITIALIZER): Likewise. * sysdeps/i386/bits/spin-lock-inline.h (__pthread_spin_init): Likewise. * sysdeps/i386/mach/spin-lock-inline.h (__pthread_spin_init): Likewise.
2009-04-082008-10-02 Neal H. Walfield <neal@gnu.org>Neal H. Walfield
* sysdeps/generic/pt-mutex-timedlock.c (__pthread_mutex_timedlock_internal) [! ALWAYS_TRACK_MUTEX_OWNER]: Don't update MUTEX->OWNER or assert MUTEX->OWNER for normal mutexes. * sysdeps/generic/pt-mutex-unlock.c (__pthread_mutex_unlock) [! ALWAYS_TRACK_MUTEX_OWNER]: Don't update MUTEX->OWNER or assert MUTEX->OWNER for normal mutexes. * sysdeps/generic/pt-mutex-transfer-np.c (__pthread_mutex_transfer_np) [! ALWAYS_TRACK_MUTEX_OWNER]: Don't update MUTEX->OWNER for normal mutexes.
2009-04-072008-08-12 Neal H. Walfield <neal@gnu.org>Neal H. Walfield
Merge changes from hurd-l4 fork. * Makefile (SRCS): Add pt-startup.c and pt-mutex-transfer-np.c. (sysdeps_headers): Add pthread-np.h. 2008-08-12 Neal H. Walfield <neal@gnu.org> * sysdeps/generic/bits/pthread-np.h: New file. 2008-08-12 Neal H. Walfield <neal@gnu.org> * sysdeps/generic/pt-startup.c: New file. 2008-08-12 Neal H. Walfield <neal@gnu.org> * sysdeps/generic/bits/mutex.h (__PTHREAD_RECURSIVE_MUTEX_INITIALIZER): Define. (__PTHREAD_MUTEX_RECURSIVE_INITIALIZER): Don't define. * include/pthread/pthread.h (PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP) [__USE_GNU]: Define. (PTHREAD_MUTEX_RECURSIVE_INITIALIZER_NP): Don't define. 2008-08-12 Neal H. Walfield <neal@gnu.org> * include/pthread/pthread.h: Include <sys/cdefs.h>. (__extern_inline): If not defined, define appropriately. 2008-06-01 Neal H. Walfield <neal@gnu.org> * include/pthread/pthread.h (PTHREAD_MUTEX_RECURSIVE_INITIALIZER_NP): New definition. * sysdeps/generic/bits/mutex.h (__PTHREAD_MUTEX_RECURSIVE_INITIALIZER): New definition. * sysdeps/generic/bits/mutex-attr.h (__pthread_recursive_mutexattr): New definition. * sysdeps/generic/pt-mutexattr.c (__pthread_recursive_mutexattr): New declaration. * sysdeps/generic/pt-mutex-init.c (_pthread_mutex_init): If ATTR is &__PTHREAD_RECURSIVE_MUTEXATTR, don't allocate a copy, just save in MUTEX->ATTR. * sysdeps/generic/pt-mutex-destroy.c (_pthread_mutex_destroy): If MUTEX->ATTR is &__PTHREAD_RECURSIVE_MUTEXATTR, don't free it. 2008-05-29 Thomas Schwinge <tschwinge@gnu.org> * sysdeps/generic/sem-timedwait.c: Don't include <error.h>. 2008-05-21 Neal H. Walfield <neal@gnu.org> * include/pthread/pthread.h: Include <bits/pthread-np.h>. 2008-03-01 Neal H. Walfield <neal@gnu.org> * sysdeps/generic/pt-mutex-transfer-np.c: New file. * pthread/pt-self.c (pthread_self): Assert that SELF is not NULL. 2007-12-23 Neal H. Walfield <neal@gnu.org> * pthread/pt-join.c (pthread_join): Cast argument to pthread_cleanup_push to avoid warning. 2007-11-23 Neal H. Walfield <neal@gnu.org> * pthread/pt-internal.h (__pthread_startup): Add declaration. * pthread/pt-create.c (entry_point): Call __pthread_startup.
2009-04-072008-08-12 Neal H. Walfield <neal@gnu.org>Neal H. Walfield
* sysdeps/generic/bits/pthread-np.h: New file.
2009-04-072008-08-12 Neal H. Walfield <neal@gnu.org>Neal H. Walfield
* sysdeps/generic/pt-startup.c (__pthread_startup): New file.
2009-04-07libpthread/Neal H. Walfield
2008-08-12 Neal H. Walfield <neal@gnu.org> * sysdeps/generic/bits/mutex.h (__PTHREAD_RECURSIVE_MUTEX_INITIALIZER): Define. (__PTHREAD_MUTEX_RECURSIVE_INITIALIZER): Don't define. * include/pthread/pthread.h (PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP) [__USE_GNU]: Define. (PTHREAD_MUTEX_RECURSIVE_INITIALIZER_NP): Don't define. libhurd-mm/ 2008-08-12 Neal H. Walfield <neal@gnu.org> * storage.c (storage_low_mutex): Use PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP, not PTHREAD_MUTEX_RECURSIVE_INITIALIZER_NP.
2009-04-072008-08-12 Neal H. Walfield <neal@gnu.org>Neal H. Walfield
Merge in Samuel Thibault's changes from the main line. * Makefile.am (libpthread_a_SOURCES): Add pt-getattr.c. * headers.m4: Link libpthread/include/pthread/pthreadtypes.h to sysroot/include/pthread/pthreadtypes.h and libpthread/sysdeps/${arch}/bits/spin-lock-inline.h. to sysroot/include/bits/spin-lock-inline.h. * include/pthread/pthread.h: Include <sys/cdefs.h>. (__extern_inline): If not defined, define appropriately. 2008-08-04 Samuel Thibault <samuel.thibault@ens-lyon.org> * include/pthread/pthreadtypes.h (__pthread_inheritsched): Remove comma at end of enumeration. 2008-08-03 Samuel Thibault <samuel.thibault@ens-lyon.org> * Makefile (sysdeps_headers): Add spin-lock-inline.h. (SYSDEP_PATH): Move sysdeps/ia32 right after sysdeps/$(MICROKERNEL)/ia32. * include/pthread/pthread.h: Include <bits/spin-lock-inline.h>. * sysdeps/ia32/bits/spin-lock.h: Move inlines to... * sysdeps/ia32/bits/spin-lock-inline.h: ... new file. 2008-08-02 Samuel Thibault <samuel.thibault@ens-lyon.org> * sysdeps/generic/bits/mutex.h: Do not include <errno.h> and <stddef.h> * sysdeps/ia32/bits/memory.h (__memory_barrier): Add memory clobber. * sysdeps/ia32/bits/spin-lock.h (__pthread_spin_trylock, __pthread_spin_unlock): Add memory clobbers. * sysdeps/l4/hurd/ia32/pt-setup.c (stack_setup): Fix reservation of stack room for initial frame. 2008-07-18 Samuel Thibault <samuel.thibault@ens-lyon.org> * Makefile (sysdeps_headers): add pthread/pthreadtypes.h 2008-06-27 Samuel Thibault <samuel.thibault@ens-lyon.org> * include/pthread/pthread.h: Do not define __need_clockid_t, include <time.h>, and define clockid_t if __clockid_defined is not defined. Include <pthread/pthreadtypes.h> (pthread_equal): New extern inline. (pthread_cleanup_push, pthread_cleanup_pop): New macros. (__pthread_process_shared, __pthread_inheritsched, __pthread_contentionscope, __pthread_detachstate, __pthread_mutex_protocol, __pthread_mutex_type, pthread_attr_t, pthread_mutex_attr_t, pthread_mutex_t, pthread_condattr_t, pthread_cond_t, pthread_spinlock_t, pthread_rwlockattr_t, pthread_rwlock_t, pthread_barrierattr_t, pthread_barrier_t, pthread_key_t, pthread_once_t): Move enums and typedefs to... * include/pthread/pthreadtypes.h: ... new file. * sysdeps/generic/bits/cancelation.h (pthread_cleanup_push): Rename macro to __pthread_cleanup_push. (pthread_cleanup_pop): Rename macro to __pthread_cleanup_pop. * sysdeps/generic/bits/barrier-attr.h (__pthread_process_shared): Forward-declare enum. * sysdeps/generic/bits/condition-attr.h (__pthread_process_shared): Likewise. * sysdeps/generic/bits/mutex-attr.h (__pthread_mutex_protocol, __pthread_process_shared, __pthread_mutex_type): Likewise. * sysdeps/generic/bits/rwlock-attr.h (__pthread_process_shared): Likewise. * sysdeps/generic/bits/thread-attr.h (__pthread_detachstate, __pthread_inheritsched, __pthread_contentionscope): Likewise. * sysdeps/generic/bits/pthread.h (pthread_t): Rename type to __pthread_t. (pthread_equal): Rename to __pthread_equal. 2008-06-27 Samuel Thibault <samuel.thibault@ens-lyon.org> * sysdeps/generic/bits/thread-barrier.h: Remove unused file. 2008-05-17 Samuel Thibault <samuel.thibault@ens-lyon.org> * include/pthread/pthread.h (pthread_getattr_np): New declaration. * pthread/pt-getattr.c: New file. * Makefile (SRCS): Add pt-getattr.c. 2008-03-16 Samuel Thibault <samuel.thibault@ens-lyon.org> * include/libc-symbols.h (HAVE_ASM_PREVIOUS_DIRECTIVE): Define. 2008-02-29 Samuel Thibault <samuel.thibault@ens-lyon.org> * sysdeps/l4/hurd/ia32/pt-setup.c (stack_setup): Align stack on 0x10 for MMX operations. 2008-01-01 Samuel Thibault <samuel.thibault@ens-lyon.org> * include/pthread/pthread.h (pthread_spin_destroy, pthread_spin_init, pthread_spin_lock, pthread_spin_trylock, pthread_spin_unlock): Use __extern_inline macro instead of extern __inline. * sysdeps/ia32/bits/spin-lock.h (__PT_SPIN_INLINE, __pthread_spin_lock): Likewise * sysdeps/generic/bits/pthread.h (pthread_equal): Declare ; only provide inline when __USE_EXTERN_INLINES is defined. Use __extern_inline macro instead of extern __inline. * sysdeps/ia32/bits/memory.h (__memory_barrier): Add static to inline.
2009-04-07viengoos/Neal H. Walfield
2008-06-22 Neal H. Walfield <neal@gnu.org> * thread.h: Include "list.h". (struct thread) [! NDEBUG]: Add field futex_waiter_node. [! NDEBUG]: Instantiate the futex_waiter list class. (futex_waiters) [! NDEBUG]: Declare. * server.c (futex_waiters) [! NDEBUG]: New variable. (server_loop) [! NDEBUG]: If we don't get an RPC for a while, dequeue all thread's enqueued on FUTEX_WAITERS and return EDEADLK. When blocking a thread on a futex, add THREAD to FUTEX_WAITERS. * object.c (object_wait_queue_dequeue) [! NDEBUG]: If THREAD->WAIT_REASON is THREAD_WAIT_FUTEX, unlink THREAD from FUTEX_WAITERS. hurd/ 2008-06-22 Neal H. Walfield <neal@gnu.org> * futex.h [! RM_INTERN]: Include <errno.h>. (futex_wait): On error, set ERRNO and return -1. (futex_timed_wait): Likewise. (futex_wake): Likewise. * mutex.h (ss_mutex_lock): If FUTEX_WAIT returns failure, print some debugging information.
2009-04-072008-06-22 Neal H. Walfield <neal@gnu.org>Neal H. Walfield
* sysdeps/generic/pt-mutex-timedlock.c (__pthread_mutex_timedlock_internal): Don't set MUTEX->OWNER here. * sysdeps/generic/pt-mutex-unlock.c (__pthread_mutex_unlock): Set it here to WAKEUP.
2009-04-072008-06-01 Neal H. Walfield <neal@gnu.org>Neal H. Walfield
* include/pthread/pthread.h (PTHREAD_MUTEX_RECURSIVE_INITIALIZER_NP): New definition. * sysdeps/generic/bits/mutex.h (__PTHREAD_MUTEX_RECURSIVE_INITIALIZER): New definition. * sysdeps/generic/bits/mutex-attr.h (__pthread_recursive_mutexattr): New definition. * sysdeps/generic/pt-mutexattr.c (__pthread_recursive_mutexattr): New declaration. * sysdeps/generic/pt-mutex-init.c (_pthread_mutex_init): If ATTR is &__PTHREAD_RECURSIVE_MUTEXATTR, don't allocate a copy, just save in MUTEX->ATTR. * sysdeps/generic/pt-mutex-destroy.c (_pthread_mutex_destroy): If MUTEX->ATTR is &__PTHREAD_RECURSIVE_MUTEXATTR, don't free it.
2009-04-072008-05-29 Thomas Schwinge <tschwinge@gnu.org>Thomas Schwinge
* sysdeps/generic/sem-timedwait.c: Don't include <error.h>.
2009-04-072008-03-01 Neal H. Walfield <neal@gnu.org>Neal H. Walfield
Add signal implementation. * Makefile.am (SYSDEP_PATH): Add $(srcdir)/signal. (libpthread_a_SOURCES): Add pt-mutex-transfer-np.c, kill.c, killpg.c, pt-kill-siginfo-np.c, raise.c, sigaction.c, sigaddset.c, sigaltstack.c, sigdelset.c, sigemptyset.c, sigfillset.c, sig-internal.c, sig-internal.h, siginterrupt.c, sigismember.c, signal.c, signal-dispatch.c, signal.h, sigpending.c, sigprocmask.c, sigsuspend.c, sigtimedwait.c, sigwait.c, sigwaiter.c, sigwaitinfo.c, signal-dispatch-lowlevel.c, and sigprocmask.c. * headers.m4: Link libpthread/signal/signal.h into ../include. * sysdeps/generic/pt-mutex-transfer-np.c: New file. * signal/README: New file. * signal/TODO: Likewise. * signal/kill.c: Likewise. * signal/pt-kill-siginfo-np.c: Likewise. * signal/sig-internal.c: Likewise. * signal/sig-internal.h: Likewise. * signal/sigaction.c: Likewise. * signal/sigaltstack.c: Likewise. * signal/signal-dispatch.c: Likewise. * signal/signal.h: Likewise. * signal/sigpending.c: Likewise. * signal/sigsuspend.c: Likewise. * signal/sigtimedwait.c: Likewise. * signal/sigwaiter.c: Likewise. * signal/sigwaitinfo.c: Likewise. * sysdeps/l4/hurd/sig-sysdep.h: Likewise. * sysdeps/l4/hurd/sigprocmask.c: Likewise. * sysdeps/generic/killpg.c: Likewise. * sysdeps/generic/pt-kill.c: Likewise. * sysdeps/generic/raise.c: Likewise. * sysdeps/generic/sigaddset.c: Likewise. * sysdeps/generic/sigdelset.c: Likewise. * sysdeps/generic/sigemptyset.c: Likewise. * sysdeps/generic/sigfillset.c: Likewise. * sysdeps/generic/siginterrupt.c: Likewise. * sysdeps/generic/sigismember.c: Likewise. * sysdeps/generic/signal.c: Likewise. * sysdeps/generic/sigwait.c: Likewise. * sysdeps/l4/hurd/ia32/signal-dispatch-lowlevel.c: Likewise. * sysdeps/l4/hurd/pt-sysdep.c (sigprocmask): Remove function. * sysdeps/l4/hurd/pt-sigstate.c (__pthread_sigstate): Implement it. * sysdeps/l4/hurd/pt-sigstate-init.c: Include <sig-internal.h>. (__pthread_sigstate_init): Initialize THREAD->SS. * sysdeps/l4/hurd/pt-kill.c: Remove file. * pthread/pt-internal.h: Include <sig-internal.h>. (PTHREAD_SIGNAL_MEMBERS) [! PTHREAD_SIGNAL_MEMBERS]: Define. (struct __pthread): Add PTHREAD_SIGNAL_MEMBERS. * pthread/pt-self.c (pthread_self): Assert that SELF is not NULL.
2009-04-072008-01-01 Neal H. Walfield <neal@gnu.org>Neal H. Walfield
* sysdeps/generic/pt-mutex-timedlock.c (__pthread_mutex_timedlock_internal): Add additional asserts. [! NDEBUG]: Keep MUTEX->OWNER up to date. * sysdeps/generic/pt-mutex-trylock.c (__pthread_mutex_trylock): Add additional asserts. [! NDEBUG]: Keep MUTEX->OWNER up to date. * sysdeps/generic/pt-mutex-unlock.c (__pthread_mutex_unlock): Add additional asserts. [! NDEBUG]: Keep MUTEX->OWNER up to date.
2009-04-072007-11-20 Neal H. Walfield <neal@gnu.org>Neal H. Walfield
Merge changes from mainline Hurd. Update L4 bits to compile with those changes. * sysdeps/l4/pt-block.c (__pthread_block): Call l4_receive, not L4_Receive. * sysdeps/l4/pt-create-np.c (pthread_create_from_l4_tid_np): Don't pass TID to __pthread_create_internal. Emit a warning. * sysdeps/l4/pt-stack-alloc.c (allocate_page): Remove function. (__pthread_stack_alloc): Don't require that STACKSIZE is equal to __pthread_stacksize. Call mmap. * sysdeps/l4/pt-thread-halt.c (__pthread_thread_halt): Take additional argument, need_dealloc. Call __pthread_dealloc. Stop the thread. * sysdeps/l4/hurd/pt-sysdep.c (init_routine): When calling __pthread_create_internal, don't pass the tid. * tests/test-1.c (main): Use pthread_mutex_init, not PTHREAD_MUTEX_INITIALIZER. * pthread/pt-alloc.c: Don't include <bits/atomic.h>. Include <atomic.h>. (__pthread_free_threads): Make it an atomicptr_t, not an __atomicptr_t. (__pthread_alloc): Don't use __atomicptr_compare_and_swap, use atomic_compare_and_exchange_val_acq. * pthread/pt-create.c: Don't include <bits/atomic.h>. Include <atomic.h>. (__pthread_total): Make it an atomic_fast32_t, not an __atomic_t. (__pthread_create_internal): Use atomic_increment and atomic_decrement, not __atomic_inc and __atomic_dec. * pthread/pt-dealloc.c: Don't include <bits/atomic.h>. Include <atomic.h>. (__pthread_free_threads): Make it an atomicptr_t, not an __atomicptr_t. (__pthread_dealloc): Use atomic_compare_and_exchange_val_acq, not __atomicptr_compare_and_swap. * pthread/pt-exit.c: Don't include <bits/atomic.h>. Include <atomic.h>. (pthread_exit): Use atomic_decrement_and_test, not __atomic_dec_and_test. * pthread/pt-internal.h: Don't include <bits/atomic.h>. Include <atomic.h>. (__pthread_total): Make it an atomic_fast32_t, not an __atomic_t. * sysdeps/powerpc/bits/atomic.h: Remove file. * sysdeps/ia32/bits/atomic.h: Likewise.
2009-04-062004-11-02 Marcus Brinkmann <marcus@gnu.org>Marcus Brinkmann
* sysdeps/generic/bits/condition.h (__PTHREAD_COND_INITIALIZER): Remove compound statement. * pthread/pt-alloc.c (initialize_pthread): Use compound statement. * sysdeps/generic/pt-cond-init.c (pthread_cond_init): Likewise.
2009-04-062004-03-23 Marcus Brinkmann <marcus@gnu.org>Marcus Brinkmann
* sysdeps/generic/bits/mutex.h (__PTHREAD_MUTEX_INITIALIZER): Remove compound statement. (pthread_mutex_init): Use compound statement with initializer. * pthread/pt-alloc.c (initialize_pthread): Likewise. * sysdeps/generic/pt-mutex-init.c (_pthread_mutex_init): Likewise.
2009-04-062004-03-17 Marcus Brinkmann <marcus@gnu.org>Marcus Brinkmann
* libpthread: New directory, populated with Neal H. Walfields pthread implementation.
2008-08-122008-08-12 Neal H. Walfield <neal@gnu.org>Neal H. Walfield
* sysdeps/generic/pt-mutex-unlock.c (__pthread_mutex_unlock): Remove dead code.
2008-08-03Update copyright year.Thomas Schwinge
2008-08-022008-08-02 Samuel Thibault <samuel.thibault@ens-lyon.org>Samuel Thibault
* sysdeps/generic/bits/mutex.h: Do not include <errno.h> and <stddef.h>
2008-07-01Update copyright years.Thomas Schwinge
2008-06-292008-06-29 Samuel Thibault <samuel.thibault@ens-lyon.org>Samuel Thibault
* sysdeps/generic/pt-mutex-unlock.c (__pthread_mutex_unlock): Do not use assertx and threadid.
2008-06-282008-06-27 Samuel Thibault <samuel.thibault@ens-lyon.org>Samuel Thibault
* include/pthread/pthread.h: Do not define __need_clockid_t, include <time.h>, and define clockid_t if __clockid_defined is not defined. Include <pthread/pthreadtypes.h> (pthread_equal): New extern inline. (pthread_cleanup_push, pthread_cleanup_pop): New macros. (__pthread_process_shared, __pthread_inheritsched, __pthread_contentionscope, __pthread_detachstate, __pthread_mutex_protocol, __pthread_mutex_type, pthread_attr_t, pthread_mutex_attr_t, pthread_mutex_t, pthread_condattr_t, pthread_cond_t, pthread_spinlock_t, pthread_rwlockattr_t, pthread_rwlock_t, pthread_barrierattr_t, pthread_barrier_t, pthread_key_t, pthread_once_t): Move enums and typedefs to... * include/pthread/pthreadtypes.h: ... new file. * sysdeps/generic/bits/cancelation.h (pthread_cleanup_push): Rename macro to __pthread_cleanup_push. (pthread_cleanup_pop): Rename macro to __pthread_cleanup_pop. * sysdeps/generic/bits/barrier-attr.h (__pthread_process_shared): Forward-declare enum. * sysdeps/generic/bits/condition-attr.h (__pthread_process_shared): Likewise. * sysdeps/generic/bits/mutex-attr.h (__pthread_mutex_protocol, __pthread_process_shared, __pthread_mutex_type): Likewise. * sysdeps/generic/bits/rwlock-attr.h (__pthread_process_shared): Likewise. * sysdeps/generic/bits/thread-attr.h (__pthread_detachstate, __pthread_inheritsched, __pthread_contentionscope): Likewise. * sysdeps/generic/bits/pthread.h (pthread_t): Rename type to __pthread_t. (pthread_equal): Rename to __pthread_equal.
2008-06-272008-06-27 Samuel Thibault <samuel.thibault@ens-lyon.org>Samuel Thibault
* sysdeps/generic/bits/thread-barrier.h: Remove unused file.
2008-06-222008-06-22 Neal H. Walfield <neal@gnu.org>Neal H. Walfield
* sysdeps/generic/pt-mutex-timedlock.c (__pthread_mutex_timedlock_internal) [! NDEBUG]: Set MUTEX->OWNER appropriately and assert that it is consistent. * sysdeps/generic/pt-mutex-unlock.c (__pthread_mutex_unlock) [! NDEBUG]: Set MUTEX->OWNER appropriately and assert that it is consistent. * sysdeps/generic/pt-mutex-trylock.c (__pthread_mutex_trylock) [! NDEBUG]: Set MUTEX->OWNER.
2008-01-012008-01-01 Samuel Thibault <samuel.thibault@ens-lyon.orgSamuel Thibault
* include/pthread/pthread.h (pthread_spin_destroy, pthread_spin_init, pthread_spin_lock, pthread_spin_trylock, pthread_spin_unlock): Use __extern_inline macro instead of extern __inline. * sysdeps/i386/bits/spin-lock.h (__PT_SPIN_INLINE, __pthread_spin_lock): Likewise * sysdeps/mach/bits/spin-lock.h (__PT_SPIN_INLINE, __pthread_spin_lock): Likewise * sysdeps/generic/bits/pthread.h (pthread_equal): Declare ; only provide inline when __USE_EXTERN_INLINES is defined. Use __extern_inline macro instead of extern __inline. * sysdeps/i386/bits/memory.h (__memory_barrier): Add static to inline.
2007-08-022007-08-02 Samuel Thibault <samuel.thibault@ens-lyon.org>Samuel Thibault
* sysdeps/generic/bits/mutex.h (pthread_mutex_init) (pthread_mutex_destroy, __pthread_mutex_lock, __pthread_mutex_trylock) (pthread_mutex_lock, pthread_mutex_trylock): Remove inline definitions. * sysdeps/generic/bits/rwlock.h (pthread_rwlock_init) (pthread_rwlock_destroy): Likewise.
2007-06-242007-06-24 Samuel Thibault <samuel.thibault@ens-lyon.org>Samuel Thibault
* include/semaphore.h (sem_timedwait): Declare only if __USE_XOPEN2K is defined. * include/pthread/pthread.h (pthread_attr_getstack) (pthread_attr_setstack, pthread_mutex_timedlock) (pthread_condattr_getclock, pthread_condattr_setclock) (pthread_rwlock_timedrdlock, pthread_rwlock_timedwrlock) (pthread_barrierattr_t, pthread_barrierattr_init) (pthread_barrierattr_destroy, pthread_barrierattr_getpshared) (pthread_barrierattr_setpshared, pthread_barrier_t) (PTHREAD_BARRIER_SERIAL_THREAD, pthread_barrier_init) (pthread_barrier_destroy, pthread_barrier_wait) (pthread_getcpuclockid): Declare only if __USE_XOPEN2K is defined. (pthread_mutexattr_getprioceiling, pthread_mutexattr_setprioceiling) (pthread_mutexattr_getprotocol, pthread_mutexattr_setprotocol) (pthread_mutexattr_gettype, pthread_mutexattr_settype) (pthread_mutex_getprioceiling, pthread_mutex_setprioceiling) (pthread_setconcurrency, pthread_getconcurrency): Declare only if __USE_UNIX98 is defined. (pthread_rwlockattr_t, pthread_rwlockattr_init) (pthread_rwlockattr_destroy, pthread_rwlockattr_getpshared) (pthread_rwlockattr_setpshared, pthread_rwlock_t, pthread_rwlock_init) (pthread_rwlock_destroy, pthread_rwlock_rdlock) (pthread_rwlock_tryrdlock, pthread_rwlock_wrlock) (pthread_rwlock_trywrlock, pthread_rwlock_unlock): Declare only if __USE_UNIX98 or __USE_XOPEN2K are defined. (PTHREAD_PRIO_NONE, PTHREAD_PRIO_INHERIT, PTHREAD_PRIO_PROTECT) (PTHREAD_MUTEX_NORMAL, PTHREAD_MUTEX_ERRORCHECK) (PTHREAD_MUTEX_RECURSIVE, PTHREAD_MUTEX_DEFAULT): Define only if __USE_UNIX98 is defined. (PTHREAD_MUTEX_FAST_NP): Define for compatibility when __USE_GNU is defined. * sysdeps/generic/bits/rwlock.h (pthread_rwlock_init) (pthread_rwlock_destroy): Declare only if __USE_UNIX98 or __USE_XOPEN2K are defined. * TODO: Drop that TODO item.
2007-03-042006-03-04 Samuel Thibault <samuel.thibault@ens-lyon.org>Samuel Thibault
* libpthread/include/pthread/pthread.h: Add the restrict keyword where appropriate for full compliance. * libpthread/pthread/pt-internal.h: Likewise. * libpthread/sysdeps/generic/bits/mutex.h: Likewise. * libpthread/sysdeps/generic/bits/rwlock.h: Likewise. * libpthread/TODO: Drop that TODO item.
2007-01-202006-01-20 Samuel Thibault <samuel.thibault@ens-lyon.org>Samuel Thibault
Do not let other libraries (like libX11) override libpthread's pthread_mutex_*, pthread_rwlock_* and sem_* dynamic symbols. * libpthread/sysdeps/generic/pt-mutex-destroy.c (pthread_mutex_destroy): Make the alias strong. * libpthread/sysdeps/generic/pt-mutex-init.c (pthread_mutex_init): Likewise. * libpthread/sysdeps/generic/pt-mutex-lock.c (_pthread_mutex_lock, pthread_mutex_lock): Likewise. * libpthread/sysdeps/generic/pt-mutex-trylock.c (_pthread_mutex_trylock, pthread_mutex_trylock): Likewise. * libpthread/sysdeps/generic/pt-mutex-unlock.c (_pthread_mutex_lock, pthread_mutex_unlock): Likewise. * libpthread/sysdeps/generic/pt-rwlock-destroy.c (pthread_rwlock_destroy): Likewise. * libpthread/sysdeps/generic/pt-rwlock-init.c (pthread_rwlock_init): Likewise. * libpthread/sysdeps/generic/sem-destroy.c (sem_destroy): Likewise. * libpthread/sysdeps/generic/sem-getvalue.c (sem_getvalue): Likewise. * libpthread/sysdeps/generic/sem-init.c (sem_init): Likewise. * libpthread/sysdeps/generic/sem-open.c (sem_open): Likewise. * libpthread/sysdeps/generic/sem-post.c (sem_post): Likewise. * libpthread/sysdeps/generic/sem-timedwait.c (sem_timedwait): Likewise. * libpthread/sysdeps/generic/sem-trywait.c (sem_trywait): Likewise. * libpthread/sysdeps/generic/sem-unlink.c (sem_unlink): Likewise. * libpthread/sysdeps/generic/sem-wait.c (sem_wait): Likewise.
2005-05-12libpthread/Neal H. Walfield
2005-05-12 Neal H. Walfield <neal@gnu.org> * include/pthread/pthread.h (pthread_exit): Add noreturn attribute. * sysdeps/generic/bits/condition.h (__PTHREAD_COND_INITIALIZER): Don't create a compound literal. * sysdeps/generic/bits/mutex.h (__PTHREAD_MUTEX_INITIALIZER): Don't create a compound literal. (pthread_mutex_init): Don't assign to *__MUTEX directly. Initialize an intermediate local variable and then copy the result. * sysdeps/generic/bits/rwlock.h (__PTHREAD_RWLOCK_INITIALIZER): Don't create a compound literal. (pthread_rwlock_init): Don't assign to *__RWLOCK directly. Initialize an intermediate local variable and then copy the result. * sysdeps/i386/bits/spin-lock.h (__SPIN_LOCK_INITIALIZER): Don't create a compound literal. * pthread/pt-alloc.c (initialize_pthread): Cast PTHREAD_MUTEX_INITIALIZER and PTHREAD_COND_INITIALIZER to create a compound literal. * tests/test-1.c (main): Use pthread_mutex_init, not PTHREAD_MUTEX_INIT for mutex initialization * sysdeps/generic/pt-barrier-init.c (pthread_barrier_init): Remove assert. Copy ATTR if non-defaults are used. * sysdeps/generic/pt-cond-init.c (pthread_cond_init): Include <string.h>. Remove assert. Copy ATTR if non-defaults are used. * sysdeps/generic/pt-mutex-init.c (_pthread_mutex_init): Cast PTHREAD_MUTEX_INITIALIZER to create a compound literal. * sysdeps/generic/pt-rwlock-init.c: Include <string.h>. (_pthread_rwlock_init): Cast __PTHREAD_RWLOCK_INITIALIZER to create a compound literal. Copy ATTR if non-defaults are used. * sysdeps/generic/pt-cond-timedwait.c (__pthread_cond_timedwait_internal): Check that ABSTIME->TV_NSEC is valid. Don't shadow ERR. Don't return before cleaning up. * sysdeps/generic/pt-mutex-timedlock.c (pthread_mutex_timedlock): Move after __pthread_mutex_timedlock_internal. Check that ABSTIME->TV_NSEC is valid. * sysdeps/generic/pt-rwlock-timedrdlock.c (pthread_rwlock_timedrdlock): Move after. __pthread_rwlock_timedrdlock_internal. (__pthread_rwlock_timedrdlock_internal): Check that ABSTIME->TV_NSEC is valid. * sysdeps/generic/pt-rwlock-timedwrlock.c (pthread_rwlock_timedwrlock): Move after __pthread_rwlock_timedwrlock_internal. (__pthread_rwlock_timedwrlock_internal): Check that ABSTIME->TV_NSEC is valid. * sysdeps/generic/sem-timedwait.c (__sem_timedwait_internal): Check that TIMEOUT->TV_NSEC is valid before enqueuing the thread. * sysdeps/generic/pt-rwlock-rdlock.c (__pthread_rwlock_timedrdlock_internal): Fix declaration. * sysdeps/generic/pt-mutex-trylock.c (__pthread_mutex_trylock): Don't return EDEADLK. POSIX does not allow it. * sysdeps/mach/pt-timedblock.c (__pthread_timedblock): Calculate the relative timeout without overflowing. * sysdeps/mach/hurd/i386/pt-setup.c (stack_setup): Cast THREAD.
2005-05-12libpthread/Neal H. Walfield
2005-05-12 Neal H. Walfield <neal@gnu.org> * Makefile (SRCS): Add sem-close.c sem-destroy.c sem-getvalue.c sem-init.c sem-open.c sem-post.c sem-timedwait.c sem-trywait.c sem-unlink.c and sem-wait.c. (sysdeps_headers): Add semaphore.h bits/semaphore.h. * include/semaphore.h: New file. * sysdeps/generic/sem-close.c: New file. * sysdeps/generic/sem-destroy.c: New file. * sysdeps/generic/sem-getvalue.c: New file. * sysdeps/generic/sem-init.c: New file. * sysdeps/generic/sem-open.c: New file. * sysdeps/generic/sem-post.c: New file. * sysdeps/generic/sem-timedwait.c: New file. * sysdeps/generic/sem-trywait.c: New file. * sysdeps/generic/sem-unlink.c: New file. * sysdeps/generic/sem-wait.c: New file. * sysdeps/generic/bits/semaphore.h: New file.
2005-05-02libpthread/Neal H. Walfield
2005-05-02 Neal H. Walfield <neal@gnu.org> * pthread/pt-alloc.c (__pthread_alloc): Set the thread id to the table index plus one. * pthread/pt-internal.h (__pthread_getid): Index __pthread_threads using THREAD - 1, not THREAD. (__pthread_setid): Likewise. * pthread/pt-create.c (__pthread_create_internal): Likewise. * sysdeps/generic/pt-mutex-trylock.c (__pthread_mutex_trylock): When returning EBUSY, don't forget to first unlock MUTEX->__HELD.
2005-04-20libpthread/Neal H. Walfield
2005-04-20 Neal H. Walfield <neal@gnu.org> * sysdeps/generic/pt-setschedparam.c: policy's type is int, not int *. * include/pthread/pthread.h: Likewise. Reported by Christopher `Physicman' Bodenstein <cb@physicman.net>.
2005-01-18libpthread/Neal H. Walfield
2005-01-12 Pietro Ferrari <pietro@bastardi.net> * include/pthread/pthread.h (pthread_spin_destroy): Replace extern inline with extern __inline. (pthread_spin_init): Likewise. (pthread_spin_lock): Likewise. (pthread_spin_trylock): Likewise. (pthread_spin_unlock): Likewise. * sysdeps/mach/bits/spin-lock.h (__pthread_spin_lock): Likewise. * sysdeps/i386/bits/spin-lock.h (__pthread_spin_lock): Likewise. * sysdeps/generic/bits/mutex.h (__pthread_mutex_trylock): Likewise. (pthread_mutex_lock): Likewise. (pthread_mutex_trylock): Likewise. * sysdeps/generic/bits/pthread.h (pthread_equal): Likewise.
2002-11-182002-11-18 Neal H. Walfield <neal@cs.uml.edu>Neal H. Walfield
* sysdeps/mach/pt-wakeup.c (__pthread_wakeup): Use the size of THREAD->wakeupmsg which may not be a mach_msg_header_t. * sysdeps/generic/pt-mutex-timedlock.c (__pthread_mutex_timedlock_internal): Really test for equality. * sysdeps/generic/pt-rwlock-timedrdlock.c (__pthread_rwlock_timedrdlock_internal): Likewise. * sysdeps/generic/pt-rwlock-timedwrlock.c (__pthread_rwlock_timedwrlock_internal): Likewise. * sysdeps/generic/pt-cond-timedwait.c (__pthread_cond_timedwait_internal): On timeout, remove our thread structure from the wait queue if necessary. * sysdeps/l4/pt-start.c (__pthread_start): Call L4_Myself, not __mach_thread_self. * sysdeps/mach/hurd/i386/pt-setup.c: Include <mach.h>. (__pthread_setup): Do not leak references from __mach_thread_self. * sysdeps/mach/hurd/pt-docancel.c (__pthread_do_cancel): Likewise. * sysdeps/mach/hurd/pt-sysdep.h (_pthread_self): Likewise. * sysdeps/mach/pt-thread-alloc.c (__pthread_thread_alloc): Likewise. * sysdeps/mach/pt-thread-start.c (__pthread_thread_start): Likewise. * sysdeps/mach/pt-start.c: Remove dead file.
2002-11-022002-11-02 Alfred M. Szmidt <ams@kemisten.nu>Neal H. Walfield
* sysdeps/generic/pt-key-delete.c, sysdeps/hurd/pt-key-delete.c (pthread_key_delete): Renamed from pthread_key_destroy. Reported by Michael Koch <konqueror@gmx.de>
2002-10-10Import libpthread.Neal H. Walfield