From 9d9358f2ebf5dd45c185b1f4d2937325ba721931 Mon Sep 17 00:00:00 2001 From: Carlos O'Donell Date: Wed, 10 Oct 2012 23:00:00 -0400 Subject: [PATCH] hppa: Update pthread.h Updates the hppa-specific pthread.h from the generic version. After this update the only difference between the generic version and the hppa version is the footer protected by the _PTHREAD_H_HPPA_ guard. --- ports/ChangeLog.hppa | 2 ++ ports/sysdeps/unix/sysv/linux/hppa/nptl/pthread.h | 22 +++++++++++++++------- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/ports/ChangeLog.hppa b/ports/ChangeLog.hppa index b9aae57..53ed276 100644 --- a/ports/ChangeLog.hppa +++ b/ports/ChangeLog.hppa @@ -1,5 +1,7 @@ 2012-10-10 Carlos O'Donell + * sysdeps/unix/sysv/linux/hppa/nptl/pthread.h: Update. + * sysdeps/unix/sysv/linux/hppa/nptl/pt-initfini.c: Removed. * sysdeps/hppa/nptl/shlib-versions: New file. diff --git a/ports/sysdeps/unix/sysv/linux/hppa/nptl/pthread.h b/ports/sysdeps/unix/sysv/linux/hppa/nptl/pthread.h index 6a0d953..0787902 100644 --- a/ports/sysdeps/unix/sysv/linux/hppa/nptl/pthread.h +++ b/ports/sysdeps/unix/sysv/linux/hppa/nptl/pthread.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2011, 2012 Free Software Foundation, Inc. +/* Copyright (C) 2002-2012 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 @@ -21,7 +21,6 @@ #include #include #include -#define __need_timespec #include #include @@ -84,7 +83,7 @@ enum /* Mutex initializers. */ -#if __WORDSIZE == 64 +#ifdef __PTHREAD_MUTEX_HAVE_PREV # define PTHREAD_MUTEX_INITIALIZER \ { { 0, 0, 0, 0, 0, 0, { 0, 0 } } } # ifdef __USE_GNU @@ -119,11 +118,20 @@ enum PTHREAD_RWLOCK_DEFAULT_NP = PTHREAD_RWLOCK_PREFER_READER_NP }; +/* Define __PTHREAD_RWLOCK_INT_FLAGS_SHARED to 1 if pthread_rwlock_t + has the shared field. All 64-bit architectures have the shared field + in pthread_rwlock_t. */ +#ifndef __PTHREAD_RWLOCK_INT_FLAGS_SHARED +# if __WORDSIZE == 64 +# define __PTHREAD_RWLOCK_INT_FLAGS_SHARED 1 +# endif +#endif + /* Read-write lock initializers. */ # define PTHREAD_RWLOCK_INITIALIZER \ { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } } # ifdef __USE_GNU -# if __WORDSIZE == 64 +# ifdef __PTHREAD_RWLOCK_INT_FLAGS_SHARED # define PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP \ { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP } } @@ -651,7 +659,7 @@ __pthread_cleanup_routine (struct __pthread_cleanup_frame *__frame) void *__cancel_arg = (arg); \ int __not_first_call = __sigsetjmp ((struct __jmp_buf_tag *) (void *) \ __cancel_buf.__cancel_jmp_buf, 0); \ - if (__builtin_expect (__not_first_call, 0)) \ + if (__glibc_unlikely (__not_first_call)) \ { \ __cancel_routine (__cancel_arg); \ __pthread_unwind_next (&__cancel_buf); \ @@ -686,7 +694,7 @@ extern void __pthread_unregister_cancel (__pthread_unwind_buf_t *__buf) void *__cancel_arg = (arg); \ int __not_first_call = __sigsetjmp ((struct __jmp_buf_tag *) (void *) \ __cancel_buf.__cancel_jmp_buf, 0); \ - if (__builtin_expect (__not_first_call, 0)) \ + if (__glibc_unlikely (__not_first_call)) \ { \ __cancel_routine (__cancel_arg); \ __pthread_unwind_next (&__cancel_buf); \ @@ -723,7 +731,7 @@ extern void __pthread_unwind_next (__pthread_unwind_buf_t *__buf) /* Function used in the macros. */ struct __jmp_buf_tag; -extern int __sigsetjmp (struct __jmp_buf_tag *__env, int __savemask) __THROW; +extern int __sigsetjmp (struct __jmp_buf_tag *__env, int __savemask) __THROWNL; /* Mutex handling. */ -- 2.7.4