summaryrefslogtreecommitdiff
path: root/pthread
AgeCommit message (Collapse)Author
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.
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.
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-04libpthread/Neal H. Walfield
2005-05-04 Neal H. Walfield <neal@gnu.org> * Makefile (SRCS): Add pt-thread_dealloc.c. * sysdeps/mach/pt-thread-dealloc.c: New file. * pthread/pt-internal.h (__pthread_thread_dealloc): New declaration. (__pthread_thread_halt): Add parameter NEED_DEALLOC. Update callers. * sysdeps/mach/pt-thread-halt.c (__pthread_thread_halt): Respect new NEED_DEALLOC parameter. Move code which deallocates kernel resources from here ... * sysdeps/mach/pt-thread-dealloc.c (__pthread_thread_dealloc): ...to here. * pthread/pt-create.c (__pthread_create_internal): Call __pthread_thread_dealloc on failure. * pthread/pt-exit.c (pthread_exit): Call __pthread_thread_dealloc. * sysdeps/mach/pt-thread-alloc.c (create_wakeupmsg): Call __mach_port_destroy to deallocate the receive right. __mach_port_deallocate won't do it. * pthread/pt-detach.c (pthread_detach): Don't call __pthread_thread_halt a second time. * sysdeps/mach/hurd/pt-sysdep.c (_cthread_init_routine): Fix declaration. (init_routine): Update declaration and remove gratuitous cast.
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.
2002-11-262002-11-26 Neal H. Walfield <neal@cs.uml.edu>Neal H. Walfield
* pthread/pt-create.c [HAVE_USELOCAL]: Include <locale.h>. (entry_point) [HAVE_USELOCALE]: Initialize the thread to the global locale.
2002-10-10Import libpthread.Neal H. Walfield