diff options
Diffstat (limited to 'nptl')
407 files changed, 1333 insertions, 963 deletions
diff --git a/nptl/DESIGN-barrier.txt b/nptl/DESIGN-barrier.txt deleted file mode 100644 index 23463c6b7e..0000000000 --- a/nptl/DESIGN-barrier.txt +++ /dev/null @@ -1,44 +0,0 @@ -Barriers pseudocode -=================== - - int pthread_barrier_wait(barrier_t *barrier); - -struct barrier_t { - - unsigned int lock: - - internal mutex - - unsigned int left; - - current barrier count, # of threads still needed. - - unsigned int init_count; - - number of threads needed for the barrier to continue. - - unsigned int curr_event; - - generation count -} - -pthread_barrier_wait(barrier_t *barrier) -{ - unsigned int event; - result = 0; - - lll_lock(barrier->lock); - if (!--barrier->left) { - barrier->curr_event++; - futex_wake(&barrier->curr_event, INT_MAX) - - result = BARRIER_SERIAL_THREAD; - } else { - event = barrier->curr_event; - lll_unlock(barrier->lock); - do { - futex_wait(&barrier->curr_event, event) - } while (event == barrier->curr_event); - } - - if (atomic_increment_val (barrier->left) == barrier->init_count) - lll_unlock(barrier->lock); - - return result; -} diff --git a/nptl/Makefile b/nptl/Makefile index aaca0a4700..dc3ccab991 100644 --- a/nptl/Makefile +++ b/nptl/Makefile @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2015 Free Software Foundation, Inc. +# Copyright (C) 2002-2016 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 @@ -212,6 +212,8 @@ CFLAGS-recvfrom.c = -fexceptions -fasynchronous-unwind-tables CFLAGS-pt-system.c = -fexceptions LDLIBS-tst-once5 = -lstdc++ +CFLAGS-tst-thread_local1.o = -std=gnu++11 +LDLIBS-tst-thread_local1 = -lstdc++ tests = tst-typesizes \ tst-attr1 tst-attr2 tst-attr3 tst-default-attr \ @@ -239,7 +241,7 @@ tests = tst-typesizes \ tst-sem1 tst-sem2 tst-sem3 tst-sem4 tst-sem5 tst-sem6 tst-sem7 \ tst-sem8 tst-sem9 tst-sem10 tst-sem11 tst-sem12 tst-sem13 tst-sem14 \ tst-sem15 \ - tst-barrier1 tst-barrier2 tst-barrier3 tst-barrier4 \ + tst-barrier1 tst-barrier2 tst-barrier3 tst-barrier4 tst-barrier5 \ tst-align tst-align3 \ tst-basic1 tst-basic2 tst-basic3 tst-basic4 tst-basic5 tst-basic6 \ tst-basic7 \ @@ -257,6 +259,7 @@ tests = tst-typesizes \ tst-cancel11 tst-cancel12 tst-cancel13 tst-cancel14 tst-cancel15 \ tst-cancel16 tst-cancel17 tst-cancel18 tst-cancel19 tst-cancel20 \ tst-cancel21 tst-cancel22 tst-cancel23 tst-cancel24 tst-cancel25 \ + tst-cancel26 tst-cancel27 \ tst-cancel-self tst-cancel-self-cancelstate \ tst-cancel-self-canceltype tst-cancel-self-testcancel \ tst-cleanup0 tst-cleanup1 tst-cleanup2 tst-cleanup3 tst-cleanup4 \ @@ -282,8 +285,10 @@ tests = tst-typesizes \ tst-vfork1 tst-vfork2 tst-vfork1x tst-vfork2x \ tst-getpid3 \ tst-setuid3 \ - tst-initializers1 $(addprefix tst-initializers1-,c89 gnu89 c99 gnu99) \ - tst-bad-schedattr + tst-initializers1 $(addprefix tst-initializers1-,\ + c89 gnu89 c99 gnu99 c11 gnu11) \ + tst-bad-schedattr \ + tst-thread_local1 tst-mutex-errorcheck xtests = tst-setuid1 tst-setuid1-static tst-setuid2 \ tst-mutexpp1 tst-mutexpp6 tst-mutexpp10 test-srcs = tst-oddstacklimit @@ -297,7 +302,7 @@ tests-nolibpthread = tst-unload gen-as-const-headers = pthread-errnos.sym \ lowlevelcond.sym lowlevelrwlock.sym \ - lowlevelbarrier.sym unwindbuf.sym \ + unwindbuf.sym \ lowlevelrobustlock.sym pthread-pi-defines.sym @@ -307,14 +312,12 @@ LDFLAGS-pthread.so = -Wl,--enable-new-dtags,-z,nodelete,-z,initfirst CFLAGS-tst-cleanup2.c = -fno-builtin CFLAGS-tst-cleanupx2.c = -fno-builtin -ifeq ($(have-forced-unwind),yes) tests += tst-cancelx2 tst-cancelx3 tst-cancelx4 tst-cancelx5 \ tst-cancelx6 tst-cancelx7 tst-cancelx8 tst-cancelx9 tst-cancelx10 \ tst-cancelx11 tst-cancelx12 tst-cancelx13 tst-cancelx14 tst-cancelx15 \ tst-cancelx16 tst-cancelx17 tst-cancelx18 tst-cancelx20 tst-cancelx21 \ tst-cleanupx0 tst-cleanupx1 tst-cleanupx2 tst-cleanupx3 tst-cleanupx4 \ tst-oncex3 tst-oncex4 -endif ifeq ($(build-shared),yes) tests += tst-atfork2 tst-tls3 tst-tls4 tst-tls5 tst-_res1 tst-fini1 \ tst-stackguard1 @@ -403,6 +406,10 @@ ifeq (,$(CXX)) # These tests require a C++ compiler and runtime. tests-unsupported += tst-cancel24 tst-cancel24-static tst-once5 endif +# These tests require a C++ compiler and runtime with thread_local support. +ifneq ($(have-cxx-thread_local),yes) +tests-unsupported += tst-thread_local1 +endif include ../Rules @@ -477,8 +484,10 @@ CFLAGS-tst-initializers1-< = $(CFLAGS-tst-initializers1.c) \ $(patsubst tst-initializers1-%.c,-std=%,$<) CFLAGS-tst-initializers1-c89.c = $(CFLAGS-tst-initializers1-<) CFLAGS-tst-initializers1-c99.c = $(CFLAGS-tst-initializers1-<) +CFLAGS-tst-initializers1-c11.c = $(CFLAGS-tst-initializers1-<) CFLAGS-tst-initializers1-gnu89.c = $(CFLAGS-tst-initializers1-<) CFLAGS-tst-initializers1-gnu99.c = $(CFLAGS-tst-initializers1-<) +CFLAGS-tst-initializers1-gnu11.c = $(CFLAGS-tst-initializers1-<) tst-cancel7-ARGS = --command "exec $(host-test-program-cmd)" tst-cancelx7-ARGS = $(tst-cancel7-ARGS) diff --git a/nptl/Versions b/nptl/Versions index 34e4b464ed..0ae5def464 100644 --- a/nptl/Versions +++ b/nptl/Versions @@ -90,10 +90,6 @@ libpthread { __pthread_once; __pthread_atfork; _IO_flockfile; _IO_ftrylockfile; _IO_funlockfile; - # Hidden entry point (through macros). - #_pthread_cleanup_pop; _pthread_cleanup_pop_restore; _pthread_cleanup_push; - #_pthread_cleanup_push_defer; - # Semaphores. sem_destroy; sem_getvalue; sem_init; sem_post; sem_trywait; sem_wait; diff --git a/nptl/alloca_cutoff.c b/nptl/alloca_cutoff.c index 74c4541671..3381ccda44 100644 --- a/nptl/alloca_cutoff.c +++ b/nptl/alloca_cutoff.c @@ -1,5 +1,5 @@ /* Determine whether block of given size can be allocated on the stack or not. - Copyright (C) 2002-2015 Free Software Foundation, Inc. + Copyright (C) 2002-2016 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 diff --git a/nptl/allocatestack.c b/nptl/allocatestack.c index c56a4df12c..c044b205c8 100644 --- a/nptl/allocatestack.c +++ b/nptl/allocatestack.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -353,7 +353,6 @@ allocate_stack (const struct pthread_attr *attr, struct pthread **pdp, struct pthread *pd; size_t size; size_t pagesize_m1 = __getpagesize () - 1; - void *stacktop; assert (powerof2 (pagesize_m1 + 1)); assert (TCB_ALIGNMENT >= STACK_ALIGN); @@ -717,19 +716,23 @@ allocate_stack (const struct pthread_attr *attr, struct pthread **pdp, /* We place the thread descriptor at the end of the stack. */ *pdp = pd; -#if TLS_TCB_AT_TP +#if _STACK_GROWS_DOWN + void *stacktop; + +# if TLS_TCB_AT_TP /* The stack begins before the TCB and the static TLS block. */ stacktop = ((char *) (pd + 1) - __static_tls_size); -#elif TLS_DTV_AT_TP +# elif TLS_DTV_AT_TP stacktop = (char *) (pd - 1); -#endif +# endif -#ifdef NEED_SEPARATE_REGISTER_STACK +# ifdef NEED_SEPARATE_REGISTER_STACK *stack = pd->stackblock; *stacksize = stacktop - *stack; -#elif _STACK_GROWS_DOWN +# else *stack = stacktop; -#elif _STACK_GROWS_UP +# endif +#else *stack = pd->stackblock; assert (*stack > 0); #endif diff --git a/nptl/cancellation.c b/nptl/cancellation.c index 2bd31686fd..717b0a4b14 100644 --- a/nptl/cancellation.c +++ b/nptl/cancellation.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. diff --git a/nptl/cleanup.c b/nptl/cleanup.c index 95923ba442..719b133ee2 100644 --- a/nptl/cleanup.c +++ b/nptl/cleanup.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. diff --git a/nptl/cleanup_compat.c b/nptl/cleanup_compat.c index d4e96aec48..cf1ad29f5e 100644 --- a/nptl/cleanup_compat.c +++ b/nptl/cleanup_compat.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -21,10 +21,8 @@ void -_pthread_cleanup_push (buffer, routine, arg) - struct _pthread_cleanup_buffer *buffer; - void (*routine) (void *); - void *arg; +_pthread_cleanup_push (struct _pthread_cleanup_buffer *buffer, + void (*routine) (void *), void *arg) { struct pthread *self = THREAD_SELF; @@ -38,9 +36,7 @@ strong_alias (_pthread_cleanup_push, __pthread_cleanup_push) void -_pthread_cleanup_pop (buffer, execute) - struct _pthread_cleanup_buffer *buffer; - int execute; +_pthread_cleanup_pop (struct _pthread_cleanup_buffer *buffer, int execute) { struct pthread *self __attribute ((unused)) = THREAD_SELF; diff --git a/nptl/cleanup_defer.c b/nptl/cleanup_defer.c index 26b955e9d0..dd2e03989b 100644 --- a/nptl/cleanup_defer.c +++ b/nptl/cleanup_defer.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. diff --git a/nptl/cleanup_defer_compat.c b/nptl/cleanup_defer_compat.c index bd70b89556..502678fb44 100644 --- a/nptl/cleanup_defer_compat.c +++ b/nptl/cleanup_defer_compat.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -20,10 +20,8 @@ void -_pthread_cleanup_push_defer (buffer, routine, arg) - struct _pthread_cleanup_buffer *buffer; - void (*routine) (void *); - void *arg; +_pthread_cleanup_push_defer (struct _pthread_cleanup_buffer *buffer, + void (*routine) (void *), void *arg) { struct pthread *self = THREAD_SELF; @@ -59,9 +57,8 @@ strong_alias (_pthread_cleanup_push_defer, __pthread_cleanup_push_defer) void -_pthread_cleanup_pop_restore (buffer, execute) - struct _pthread_cleanup_buffer *buffer; - int execute; +_pthread_cleanup_pop_restore (struct _pthread_cleanup_buffer *buffer, + int execute) { struct pthread *self = THREAD_SELF; diff --git a/nptl/cleanup_routine.c b/nptl/cleanup_routine.c index 0f7f2da4eb..b09665efb3 100644 --- a/nptl/cleanup_routine.c +++ b/nptl/cleanup_routine.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003-2015 Free Software Foundation, Inc. +/* Copyright (C) 2003-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2003. diff --git a/nptl/createthread.c b/nptl/createthread.c index 2c1ea4783c..ba2f9c7167 100644 --- a/nptl/createthread.c +++ b/nptl/createthread.c @@ -1,5 +1,5 @@ /* Low-level thread creation for NPTL. Stub version. - Copyright (C) 2014-2015 Free Software Foundation, Inc. + Copyright (C) 2014-2016 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 diff --git a/nptl/default-sched.h b/nptl/default-sched.h index 73aef41d93..4c2bba65e8 100644 --- a/nptl/default-sched.h +++ b/nptl/default-sched.h @@ -1,5 +1,5 @@ /* Determine calling thread's scheduling parameters. Stub version. - Copyright (C) 2014-2015 Free Software Foundation, Inc. + Copyright (C) 2014-2016 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 diff --git a/nptl/descr.h b/nptl/descr.h index a502048b44..8e4938deb5 100644 --- a/nptl/descr.h +++ b/nptl/descr.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -32,9 +32,7 @@ #include <dl-sysdep.h> #include "../nptl_db/thread_db.h" #include <tls.h> -#ifdef HAVE_FORCED_UNWIND -# include <unwind.h> -#endif +#include <unwind.h> #define __need_res_state #include <resolv.h> #include <kernel-features.h> @@ -362,10 +360,8 @@ struct pthread /* Next descriptor with a pending event. */ struct pthread *nextevent; -#ifdef HAVE_FORCED_UNWIND /* Machine-specific unwind info. */ struct _Unwind_Exception exc; -#endif /* If nonzero pointer to area allocated for the stack and its size. */ diff --git a/nptl/eintr.c b/nptl/eintr.c index 91faac0e68..7271d9b630 100644 --- a/nptl/eintr.c +++ b/nptl/eintr.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003-2015 Free Software Foundation, Inc. +/* Copyright (C) 2003-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2003. diff --git a/nptl/events.c b/nptl/events.c index fd137efd8c..49653c98a2 100644 --- a/nptl/events.c +++ b/nptl/events.c @@ -1,5 +1,5 @@ /* Event functions used while debugging. - Copyright (C) 1999-2015 Free Software Foundation, Inc. + Copyright (C) 1999-2016 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 diff --git a/nptl/forward.c b/nptl/forward.c index db74f8df92..42a729e407 100644 --- a/nptl/forward.c +++ b/nptl/forward.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -197,8 +197,9 @@ FORWARD (pthread_mutex_unlock, (pthread_mutex_t *mutex), (mutex), 0) FORWARD2 (pthread_self, pthread_t, (void), (), return 0) -FORWARD (pthread_setcancelstate, (int state, int *oldstate), (state, oldstate), - 0) +FORWARD (__pthread_setcancelstate, (int state, int *oldstate), + (state, oldstate), 0) +strong_alias (__pthread_setcancelstate, pthread_setcancelstate) FORWARD (pthread_setcanceltype, (int type, int *oldtype), (type, oldtype), 0) diff --git a/nptl/herrno.c b/nptl/herrno.c index 9c91528095..921a66d5fb 100644 --- a/nptl/herrno.c +++ b/nptl/herrno.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1996-2015 Free Software Foundation, Inc. +/* Copyright (C) 1996-2016 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 diff --git a/nptl/libc-cancellation.c b/nptl/libc-cancellation.c index cc9dc069a5..ba0fb4eda9 100644 --- a/nptl/libc-cancellation.c +++ b/nptl/libc-cancellation.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. diff --git a/nptl/libc-cleanup.c b/nptl/libc-cleanup.c index 87c4989566..e96c277427 100644 --- a/nptl/libc-cleanup.c +++ b/nptl/libc-cleanup.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. diff --git a/nptl/libc-lowlevellock.c b/nptl/libc-lowlevellock.c index c71ea05312..2f863bf214 100644 --- a/nptl/libc-lowlevellock.c +++ b/nptl/libc-lowlevellock.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003-2015 Free Software Foundation, Inc. +/* Copyright (C) 2003-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Paul Mackerras <paulus@au.ibm.com>, 2003. diff --git a/nptl/libc_multiple_threads.c b/nptl/libc_multiple_threads.c index aaea97d118..90c5452499 100644 --- a/nptl/libc_multiple_threads.c +++ b/nptl/libc_multiple_threads.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. diff --git a/nptl/libc_pthread_init.c b/nptl/libc_pthread_init.c index 18844ad72b..49cd05a81a 100644 --- a/nptl/libc_pthread_init.c +++ b/nptl/libc_pthread_init.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -23,7 +23,7 @@ #include <tls.h> #include <string.h> #include <pthreadP.h> -#include <bits/libc-lock.h> +#include <libc-lock.h> #include <sysdep.h> #include <ldsodefs.h> @@ -38,10 +38,9 @@ extern int __libc_multiple_threads attribute_hidden; int * #endif -__libc_pthread_init (ptr, reclaim, functions) - unsigned long int *ptr; - void (*reclaim) (void); - const struct pthread_functions *functions; +internal_function +__libc_pthread_init (unsigned long int *ptr, void (*reclaim) (void), + const struct pthread_functions *functions) { /* Remember the pointer to the generation counter in libpthread. */ __fork_generation_pointer = ptr; diff --git a/nptl/lll_timedlock_wait.c b/nptl/lll_timedlock_wait.c index 37cf08345b..0f537ba1f1 100644 --- a/nptl/lll_timedlock_wait.c +++ b/nptl/lll_timedlock_wait.c @@ -1,5 +1,5 @@ /* Timed low level locking for pthread library. Generic futex-using version. - Copyright (C) 2003-2015 Free Software Foundation, Inc. + Copyright (C) 2003-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Paul Mackerras <paulus@au.ibm.com>, 2003. diff --git a/nptl/lll_timedwait_tid.c b/nptl/lll_timedwait_tid.c index 68b4857095..a1da2998ff 100644 --- a/nptl/lll_timedwait_tid.c +++ b/nptl/lll_timedwait_tid.c @@ -1,5 +1,5 @@ /* Timed waiting for thread death. Generic futex-using version. - Copyright (C) 2003-2015 Free Software Foundation, Inc. + Copyright (C) 2003-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Paul Mackerras <paulus@au.ibm.com>, 2003. diff --git a/nptl/lowlevelbarrier.sym b/nptl/lowlevelbarrier.sym deleted file mode 100644 index cfe22b0892..0000000000 --- a/nptl/lowlevelbarrier.sym +++ /dev/null @@ -1,12 +0,0 @@ -#include <stddef.h> -#include <sched.h> -#include <bits/pthreadtypes.h> -#include "internaltypes.h" - --- - -CURR_EVENT offsetof (struct pthread_barrier, curr_event) -MUTEX offsetof (struct pthread_barrier, lock) -LEFT offsetof (struct pthread_barrier, left) -INIT_COUNT offsetof (struct pthread_barrier, init_count) -PRIVATE offsetof (struct pthread_barrier, private) diff --git a/nptl/lowlevellock.c b/nptl/lowlevellock.c index 7025b9e4fc..585be83204 100644 --- a/nptl/lowlevellock.c +++ b/nptl/lowlevellock.c @@ -1,5 +1,5 @@ /* low level locking for pthread library. Generic futex-using version. - Copyright (C) 2003-2015 Free Software Foundation, Inc. + Copyright (C) 2003-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Paul Mackerras <paulus@au.ibm.com>, 2003. diff --git a/nptl/lowlevelrobustlock.c b/nptl/lowlevelrobustlock.c index 3a2725c47e..3b988b2e31 100644 --- a/nptl/lowlevelrobustlock.c +++ b/nptl/lowlevelrobustlock.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2006-2015 Free Software Foundation, Inc. +/* Copyright (C) 2006-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Jakub Jelinek <jakub@redhat.com>, 2006. diff --git a/nptl/nptl-init.c b/nptl/nptl-init.c index c043fb50ab..bdbdfedcef 100644 --- a/nptl/nptl-init.c +++ b/nptl/nptl-init.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -127,7 +127,7 @@ static const struct pthread_functions pthread_functions = .ptr_pthread_mutex_lock = __pthread_mutex_lock, .ptr_pthread_mutex_unlock = __pthread_mutex_unlock, .ptr_pthread_self = __pthread_self, - .ptr_pthread_setcancelstate = __pthread_setcancelstate, + .ptr___pthread_setcancelstate = __pthread_setcancelstate, .ptr_pthread_setcanceltype = __pthread_setcanceltype, .ptr___pthread_cleanup_upto = __pthread_cleanup_upto, .ptr___pthread_once = __pthread_once, diff --git a/nptl/old_pthread_atfork.c b/nptl/old_pthread_atfork.c index 26eeadd8aa..fad315a619 100644 --- a/nptl/old_pthread_atfork.c +++ b/nptl/old_pthread_atfork.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. diff --git a/nptl/old_pthread_cond_broadcast.c b/nptl/old_pthread_cond_broadcast.c index 77d49e1cce..379506f416 100644 --- a/nptl/old_pthread_cond_broadcast.c +++ b/nptl/old_pthread_cond_broadcast.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -25,8 +25,7 @@ #if SHLIB_COMPAT(libpthread, GLIBC_2_0, GLIBC_2_3_2) int -__pthread_cond_broadcast_2_0 (cond) - pthread_cond_2_0_t *cond; +__pthread_cond_broadcast_2_0 (pthread_cond_2_0_t *cond) { if (cond->cond == NULL) { diff --git a/nptl/old_pthread_cond_destroy.c b/nptl/old_pthread_cond_destroy.c index 90b140ee40..ff4a6fe636 100644 --- a/nptl/old_pthread_cond_destroy.c +++ b/nptl/old_pthread_cond_destroy.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -23,8 +23,7 @@ #if SHLIB_COMPAT(libpthread, GLIBC_2_0, GLIBC_2_3_2) int -__pthread_cond_destroy_2_0 (cond) - pthread_cond_2_0_t *cond; +__pthread_cond_destroy_2_0 (pthread_cond_2_0_t *cond) { /* Free the memory which was eventually allocated. */ free (cond->cond); diff --git a/nptl/old_pthread_cond_init.c b/nptl/old_pthread_cond_init.c index 815e67e15a..71b3a18f83 100644 --- a/nptl/old_pthread_cond_init.c +++ b/nptl/old_pthread_cond_init.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -23,9 +23,8 @@ #if SHLIB_COMPAT(libpthread, GLIBC_2_0, GLIBC_2_3_2) int -__pthread_cond_init_2_0 (cond, cond_attr) - pthread_cond_2_0_t *cond; - const pthread_condattr_t *cond_attr; +__pthread_cond_init_2_0 (pthread_cond_2_0_t *cond, + const pthread_condattr_t *cond_attr) { struct pthread_condattr *icond_attr = (struct pthread_condattr *) cond_attr; diff --git a/nptl/old_pthread_cond_signal.c b/nptl/old_pthread_cond_signal.c index 062fa7198d..e4a92a288f 100644 --- a/nptl/old_pthread_cond_signal.c +++ b/nptl/old_pthread_cond_signal.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -25,8 +25,7 @@ #if SHLIB_COMPAT(libpthread, GLIBC_2_0, GLIBC_2_3_2) int -__pthread_cond_signal_2_0 (cond) - pthread_cond_2_0_t *cond; +__pthread_cond_signal_2_0 (pthread_cond_2_0_t *cond) { if (cond->cond == NULL) { diff --git a/nptl/old_pthread_cond_timedwait.c b/nptl/old_pthread_cond_timedwait.c index 501f2abb23..7990db070a 100644 --- a/nptl/old_pthread_cond_timedwait.c +++ b/nptl/old_pthread_cond_timedwait.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -25,10 +25,8 @@ #if SHLIB_COMPAT(libpthread, GLIBC_2_0, GLIBC_2_3_2) int -__pthread_cond_timedwait_2_0 (cond, mutex, abstime) - pthread_cond_2_0_t *cond; - pthread_mutex_t *mutex; - const struct timespec *abstime; +__pthread_cond_timedwait_2_0 (pthread_cond_2_0_t *cond, pthread_mutex_t *mutex, + const struct timespec *abstime) { if (cond->cond == NULL) { diff --git a/nptl/old_pthread_cond_wait.c b/nptl/old_pthread_cond_wait.c index 418a865056..caadbd9be9 100644 --- a/nptl/old_pthread_cond_wait.c +++ b/nptl/old_pthread_cond_wait.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -25,9 +25,7 @@ #if SHLIB_COMPAT(libpthread, GLIBC_2_0, GLIBC_2_3_2) int -__pthread_cond_wait_2_0 (cond, mutex) - pthread_cond_2_0_t *cond; - pthread_mutex_t *mutex; +__pthread_cond_wait_2_0 (pthread_cond_2_0_t *cond, pthread_mutex_t *mutex) { if (cond->cond == NULL) { diff --git a/nptl/perf.c b/nptl/perf.c index 953852e9e8..0f7af71a26 100644 --- a/nptl/perf.c +++ b/nptl/perf.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. diff --git a/nptl/pt-allocrtsig.c b/nptl/pt-allocrtsig.c index 071df097a6..b84d4a9f0c 100644 --- a/nptl/pt-allocrtsig.c +++ b/nptl/pt-allocrtsig.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. diff --git a/nptl/pt-cleanup.c b/nptl/pt-cleanup.c index ce239a6c89..d04686b1cd 100644 --- a/nptl/pt-cleanup.c +++ b/nptl/pt-cleanup.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. diff --git a/nptl/pt-crti.S b/nptl/pt-crti.S index b9e9c715e7..5af5570b58 100644 --- a/nptl/pt-crti.S +++ b/nptl/pt-crti.S @@ -1,5 +1,5 @@ /* Special .init and .fini section support for libpthread. - Copyright (C) 2012-2015 Free Software Foundation, Inc. + Copyright (C) 2012-2016 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 diff --git a/nptl/pt-fork.c b/nptl/pt-fork.c index fd6544b266..b65d6b4edd 100644 --- a/nptl/pt-fork.c +++ b/nptl/pt-fork.c @@ -1,5 +1,5 @@ /* ABI compatibility for 'fork' symbol in libpthread ABI. - Copyright (C) 2002-2015 Free Software Foundation, Inc. + Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. diff --git a/nptl/pt-longjmp.c b/nptl/pt-longjmp.c index f192461c66..a1cc286685 100644 --- a/nptl/pt-longjmp.c +++ b/nptl/pt-longjmp.c @@ -1,5 +1,5 @@ /* ABI compatibility for 'longjmp' and 'siglongjmp' symbols in libpthread ABI. - Copyright (C) 2002-2015 Free Software Foundation, Inc. + Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. diff --git a/nptl/pt-raise.c b/nptl/pt-raise.c index c0f16e99be..3aab899383 100644 --- a/nptl/pt-raise.c +++ b/nptl/pt-raise.c @@ -1,5 +1,5 @@ /* ISO C raise function for libpthread. - Copyright (C) 2002-2015 Free Software Foundation, Inc. + Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -22,8 +22,7 @@ int -raise (sig) - int sig; +raise (int sig) { /* This is what POSIX says must happen. */ return pthread_kill (pthread_self (), sig); diff --git a/nptl/pt-system.c b/nptl/pt-system.c index 389581f427..56f2a8901f 100644 --- a/nptl/pt-system.c +++ b/nptl/pt-system.c @@ -1,5 +1,5 @@ /* ABI compatibility for 'system' symbol in libpthread ABI. - Copyright (C) 2002-2015 Free Software Foundation, Inc. + Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. diff --git a/nptl/pt-vfork.c b/nptl/pt-vfork.c index aebb7b6bd6..8f4be0c4b3 100644 --- a/nptl/pt-vfork.c +++ b/nptl/pt-vfork.c @@ -1,5 +1,5 @@ /* vfork ABI-compatibility entry points for libpthread. - Copyright (C) 2014-2015 Free Software Foundation, Inc. + Copyright (C) 2014-2016 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 diff --git a/nptl/pthread-pids.h b/nptl/pthread-pids.h index 33d764cf82..3271918070 100644 --- a/nptl/pthread-pids.h +++ b/nptl/pthread-pids.h @@ -1,5 +1,5 @@ /* Initialize pid and tid fields of struct pthread. Stub version. - Copyright (C) 2015 Free Software Foundation, Inc. + Copyright (C) 2015-2016 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 diff --git a/nptl/pthreadP.h b/nptl/pthreadP.h index 8cd51c65ad..4edc74b1ef 100644 --- a/nptl/pthreadP.h +++ b/nptl/pthreadP.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -504,6 +504,7 @@ hidden_proto (__pthread_key_create) hidden_proto (__pthread_getspecific) hidden_proto (__pthread_setspecific) hidden_proto (__pthread_once) +hidden_proto (__pthread_setcancelstate) #endif extern int __pthread_cond_broadcast_2_0 (pthread_cond_2_0_t *cond); diff --git a/nptl/pthread_atfork.c b/nptl/pthread_atfork.c index 8f873a3cc1..966e7d57ba 100644 --- a/nptl/pthread_atfork.c +++ b/nptl/pthread_atfork.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -48,10 +48,8 @@ int /* Don't mark the compatibility function as hidden. */ attribute_hidden #endif -__pthread_atfork (prepare, parent, child) - void (*prepare) (void); - void (*parent) (void); - void (*child) (void); +__pthread_atfork (void (*prepare) (void), void (*parent) (void), + void (*child) (void)) { return __register_atfork (prepare, parent, child, &__dso_handle == NULL ? NULL : __dso_handle); diff --git a/nptl/pthread_attr_destroy.c b/nptl/pthread_attr_destroy.c index 72ee19eca9..6f8e9aea34 100644 --- a/nptl/pthread_attr_destroy.c +++ b/nptl/pthread_attr_destroy.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -24,8 +24,7 @@ #include <shlib-compat.h> int -__pthread_attr_destroy (attr) - pthread_attr_t *attr; +__pthread_attr_destroy (pthread_attr_t *attr) { struct pthread_attr *iattr; diff --git a/nptl/pthread_attr_getaffinity.c b/nptl/pthread_attr_getaffinity.c index 8aa772f5c6..be4b7e926d 100644 --- a/nptl/pthread_attr_getaffinity.c +++ b/nptl/pthread_attr_getaffinity.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003-2015 Free Software Foundation, Inc. +/* Copyright (C) 2003-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2003. diff --git a/nptl/pthread_attr_getdetachstate.c b/nptl/pthread_attr_getdetachstate.c index 92d683dc5c..5fbbfc635b 100644 --- a/nptl/pthread_attr_getdetachstate.c +++ b/nptl/pthread_attr_getdetachstate.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -21,9 +21,7 @@ int -__pthread_attr_getdetachstate (attr, detachstate) - const pthread_attr_t *attr; - int *detachstate; +__pthread_attr_getdetachstate (const pthread_attr_t *attr, int *detachstate) { struct pthread_attr *iattr; diff --git a/nptl/pthread_attr_getguardsize.c b/nptl/pthread_attr_getguardsize.c index 83cb8016ea..75b217ee75 100644 --- a/nptl/pthread_attr_getguardsize.c +++ b/nptl/pthread_attr_getguardsize.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -21,9 +21,7 @@ int -pthread_attr_getguardsize (attr, guardsize) - const pthread_attr_t *attr; - size_t *guardsize; +pthread_attr_getguardsize (const pthread_attr_t *attr, size_t *guardsize) { struct pthread_attr *iattr; diff --git a/nptl/pthread_attr_getinheritsched.c b/nptl/pthread_attr_getinheritsched.c index 9a0e8e6b8f..624c718fda 100644 --- a/nptl/pthread_attr_getinheritsched.c +++ b/nptl/pthread_attr_getinheritsched.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -21,9 +21,7 @@ int -__pthread_attr_getinheritsched (attr, inherit) - const pthread_attr_t *attr; - int *inherit; +__pthread_attr_getinheritsched (const pthread_attr_t *attr, int *inherit) { struct pthread_attr *iattr; diff --git a/nptl/pthread_attr_getschedparam.c b/nptl/pthread_attr_getschedparam.c index 3f38bd711d..c9761e07d1 100644 --- a/nptl/pthread_attr_getschedparam.c +++ b/nptl/pthread_attr_getschedparam.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -22,9 +22,8 @@ int -__pthread_attr_getschedparam (attr, param) - const pthread_attr_t *attr; - struct sched_param *param; +__pthread_attr_getschedparam (const pthread_attr_t *attr, + struct sched_param *param) { struct pthread_attr *iattr; diff --git a/nptl/pthread_attr_getschedpolicy.c b/nptl/pthread_attr_getschedpolicy.c index 19996a68de..3ca76e2c27 100644 --- a/nptl/pthread_attr_getschedpolicy.c +++ b/nptl/pthread_attr_getschedpolicy.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -21,9 +21,7 @@ int -__pthread_attr_getschedpolicy (attr, policy) - const pthread_attr_t *attr; - int *policy; +__pthread_attr_getschedpolicy (const pthread_attr_t *attr, int *policy) { struct pthread_attr *iattr; diff --git a/nptl/pthread_attr_getscope.c b/nptl/pthread_attr_getscope.c index e72247a99a..26f89d15a2 100644 --- a/nptl/pthread_attr_getscope.c +++ b/nptl/pthread_attr_getscope.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -21,9 +21,7 @@ int -__pthread_attr_getscope (attr, scope) - const pthread_attr_t *attr; - int *scope; +__pthread_attr_getscope (const pthread_attr_t *attr, int *scope) { struct pthread_attr *iattr; diff --git a/nptl/pthread_attr_getstack.c b/nptl/pthread_attr_getstack.c index 96c15c58ad..1dce3bd141 100644 --- a/nptl/pthread_attr_getstack.c +++ b/nptl/pthread_attr_getstack.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -21,10 +21,8 @@ int -__pthread_attr_getstack (attr, stackaddr, stacksize) - const pthread_attr_t *attr; - void **stackaddr; - size_t *stacksize; +__pthread_attr_getstack (const pthread_attr_t *attr, void **stackaddr, + size_t *stacksize) { struct pthread_attr *iattr; diff --git a/nptl/pthread_attr_getstackaddr.c b/nptl/pthread_attr_getstackaddr.c index 9c85cec202..da1b980799 100644 --- a/nptl/pthread_attr_getstackaddr.c +++ b/nptl/pthread_attr_getstackaddr.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -22,9 +22,7 @@ int -__pthread_attr_getstackaddr (attr, stackaddr) - const pthread_attr_t *attr; - void **stackaddr; +__pthread_attr_getstackaddr (const pthread_attr_t *attr, void **stackaddr) { struct pthread_attr *iattr; diff --git a/nptl/pthread_attr_getstacksize.c b/nptl/pthread_attr_getstacksize.c index ab18c27ae0..482e666813 100644 --- a/nptl/pthread_attr_getstacksize.c +++ b/nptl/pthread_attr_getstacksize.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -21,9 +21,7 @@ int -__pthread_attr_getstacksize (attr, stacksize) - const pthread_attr_t *attr; - size_t *stacksize; +__pthread_attr_getstacksize (const pthread_attr_t *attr, size_t *stacksize) { struct pthread_attr *iattr; diff --git a/nptl/pthread_attr_init.c b/nptl/pthread_attr_init.c index 89bec2959b..554c7c5b7b 100644 --- a/nptl/pthread_attr_init.c +++ b/nptl/pthread_attr_init.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -30,8 +30,7 @@ int __attr_list_lock = LLL_LOCK_INITIALIZER; int -__pthread_attr_init_2_1 (attr) - pthread_attr_t *attr; +__pthread_attr_init_2_1 (pthread_attr_t *attr) { struct pthread_attr *iattr; @@ -54,8 +53,7 @@ versioned_symbol (libpthread, __pthread_attr_init_2_1, pthread_attr_init, #if SHLIB_COMPAT(libpthread, GLIBC_2_0, GLIBC_2_1) int -__pthread_attr_init_2_0 (attr) - pthread_attr_t *attr; +__pthread_attr_init_2_0 (pthread_attr_t *attr) { /* This code is specific to the old LinuxThread code which has a too small pthread_attr_t definition. The struct looked like diff --git a/nptl/pthread_attr_setaffinity.c b/nptl/pthread_attr_setaffinity.c index 7a127b80f7..a22b1d5049 100644 --- a/nptl/pthread_attr_setaffinity.c +++ b/nptl/pthread_attr_setaffinity.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003-2015 Free Software Foundation, Inc. +/* Copyright (C) 2003-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2003. @@ -23,7 +23,6 @@ #include <string.h> #include <pthreadP.h> #include <shlib-compat.h> -#include <check-cpuset.h> int @@ -43,11 +42,6 @@ __pthread_attr_setaffinity_new (pthread_attr_t *attr, size_t cpusetsize, } else { - int ret = check_cpuset_attr (cpuset, cpusetsize); - - if (ret) - return ret; - if (iattr->cpusetsize != cpusetsize) { void *newp = (cpu_set_t *) realloc (iattr->cpuset, cpusetsize); diff --git a/nptl/pthread_attr_setdetachstate.c b/nptl/pthread_attr_setdetachstate.c index ad0d43135a..73d1fe3c40 100644 --- a/nptl/pthread_attr_setdetachstate.c +++ b/nptl/pthread_attr_setdetachstate.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -22,9 +22,7 @@ int -__pthread_attr_setdetachstate (attr, detachstate) - pthread_attr_t *attr; - int detachstate; +__pthread_attr_setdetachstate (pthread_attr_t *attr, int detachstate) { struct pthread_attr *iattr; diff --git a/nptl/pthread_attr_setguardsize.c b/nptl/pthread_attr_setguardsize.c index 86df9715d8..a5bc655035 100644 --- a/nptl/pthread_attr_setguardsize.c +++ b/nptl/pthread_attr_setguardsize.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -21,9 +21,7 @@ int -pthread_attr_setguardsize (attr, guardsize) - pthread_attr_t *attr; - size_t guardsize; +pthread_attr_setguardsize (pthread_attr_t *attr, size_t guardsize) { struct pthread_attr *iattr; diff --git a/nptl/pthread_attr_setinheritsched.c b/nptl/pthread_attr_setinheritsched.c index 477072d8de..80108609a3 100644 --- a/nptl/pthread_attr_setinheritsched.c +++ b/nptl/pthread_attr_setinheritsched.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -22,9 +22,7 @@ int -__pthread_attr_setinheritsched (attr, inherit) - pthread_attr_t *attr; - int inherit; +__pthread_attr_setinheritsched (pthread_attr_t *attr, int inherit) { struct pthread_attr *iattr; diff --git a/nptl/pthread_attr_setschedparam.c b/nptl/pthread_attr_setschedparam.c index f6347a78c8..99d1835de6 100644 --- a/nptl/pthread_attr_setschedparam.c +++ b/nptl/pthread_attr_setschedparam.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -23,9 +23,8 @@ int -__pthread_attr_setschedparam (attr, param) - pthread_attr_t *attr; - const struct sched_param *param; +__pthread_attr_setschedparam (pthread_attr_t *attr, + const struct sched_param *param) { assert (sizeof (*attr) >= sizeof (struct pthread_attr)); struct pthread_attr *iattr = (struct pthread_attr *) attr; diff --git a/nptl/pthread_attr_setschedpolicy.c b/nptl/pthread_attr_setschedpolicy.c index 70f439590f..866ba999e5 100644 --- a/nptl/pthread_attr_setschedpolicy.c +++ b/nptl/pthread_attr_setschedpolicy.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -22,9 +22,7 @@ int -__pthread_attr_setschedpolicy (attr, policy) - pthread_attr_t *attr; - int policy; +__pthread_attr_setschedpolicy (pthread_attr_t *attr, int policy) { struct pthread_attr *iattr; diff --git a/nptl/pthread_attr_setscope.c b/nptl/pthread_attr_setscope.c index 8f510bfec2..75710f9d3b 100644 --- a/nptl/pthread_attr_setscope.c +++ b/nptl/pthread_attr_setscope.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -22,9 +22,7 @@ int -__pthread_attr_setscope (attr, scope) - pthread_attr_t *attr; - int scope; +__pthread_attr_setscope (pthread_attr_t *attr, int scope) { struct pthread_attr *iattr; diff --git a/nptl/pthread_attr_setstack.c b/nptl/pthread_attr_setstack.c index 6898f72540..14b6ec59e1 100644 --- a/nptl/pthread_attr_setstack.c +++ b/nptl/pthread_attr_setstack.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -28,10 +28,8 @@ int -__pthread_attr_setstack (attr, stackaddr, stacksize) - pthread_attr_t *attr; - void *stackaddr; - size_t stacksize; +__pthread_attr_setstack (pthread_attr_t *attr, void *stackaddr, + size_t stacksize) { struct pthread_attr *iattr; diff --git a/nptl/pthread_attr_setstackaddr.c b/nptl/pthread_attr_setstackaddr.c index 2c028a54fa..74034cdb94 100644 --- a/nptl/pthread_attr_setstackaddr.c +++ b/nptl/pthread_attr_setstackaddr.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -22,9 +22,7 @@ int -__pthread_attr_setstackaddr (attr, stackaddr) - pthread_attr_t *attr; - void *stackaddr; +__pthread_attr_setstackaddr (pthread_attr_t *attr, void *stackaddr) { struct pthread_attr *iattr; diff --git a/nptl/pthread_attr_setstacksize.c b/nptl/pthread_attr_setstacksize.c index a0cda0cbce..c1173d5e3e 100644 --- a/nptl/pthread_attr_setstacksize.c +++ b/nptl/pthread_attr_setstacksize.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -27,9 +27,7 @@ int -__pthread_attr_setstacksize (attr, stacksize) - pthread_attr_t *attr; - size_t stacksize; +__pthread_attr_setstacksize (pthread_attr_t *attr, size_t stacksize) { struct pthread_attr *iattr; diff --git a/nptl/pthread_barrier_destroy.c b/nptl/pthread_barrier_destroy.c index 985d718a5a..92d2027c24 100644 --- a/nptl/pthread_barrier_destroy.c +++ b/nptl/pthread_barrier_destroy.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -18,26 +18,44 @@ #include <errno.h> #include "pthreadP.h" -#include <lowlevellock.h> +#include <atomic.h> +#include <futex-internal.h> int -pthread_barrier_destroy (barrier) - pthread_barrier_t *barrier; +pthread_barrier_destroy (pthread_barrier_t *barrier) { - struct pthread_barrier *ibarrier; - int result = EBUSY; - - ibarrier = (struct pthread_barrier *) barrier; - - lll_lock (ibarrier->lock, ibarrier->private ^ FUTEX_PRIVATE_FLAG); - - if (__glibc_likely (ibarrier->left == ibarrier->init_count)) - /* The barrier is not used anymore. */ - result = 0; - else - /* Still used, return with an error. */ - lll_unlock (ibarrier->lock, ibarrier->private ^ FUTEX_PRIVATE_FLAG); - - return result; + struct pthread_barrier *bar = (struct pthread_barrier *) barrier; + + /* Destroying a barrier is only allowed if no thread is blocked on it. + Thus, there is no unfinished round, and all modifications to IN will + have happened before us (either because the calling thread took part + in the most recent round and thus synchronized-with all other threads + entering, or the program ensured this through other synchronization). + We must wait until all threads that entered so far have confirmed that + they have exited as well. To get the notification, pretend that we have + reached the reset threshold. */ + unsigned int count = bar->count; + unsigned int max_in_before_reset = BARRIER_IN_THRESHOLD + - BARRIER_IN_THRESHOLD % count; + /* Relaxed MO sufficient because the program must have ensured that all + modifications happen-before this load (see above). */ + unsigned int in = atomic_load_relaxed (&bar->in); + /* Trigger reset. The required acquire MO is below. */ + if (atomic_fetch_add_relaxed (&bar->out, max_in_before_reset - in) < in) + { + /* Not all threads confirmed yet that they have exited, so another + thread will perform a reset. Wait until that has happened. */ + while (in != 0) + { + futex_wait_simple (&bar->in, in, bar->shared); + in = atomic_load_relaxed (&bar->in); + } + } + /* We must ensure that memory reuse happens after all prior use of the + barrier (specifically, synchronize-with the reset of the barrier or the + confirmation of threads leaving the barrier). */ + atomic_thread_fence_acquire (); + + return 0; } diff --git a/nptl/pthread_barrier_init.c b/nptl/pthread_barrier_init.c index 8fe15ecba5..822e17e495 100644 --- a/nptl/pthread_barrier_init.c +++ b/nptl/pthread_barrier_init.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -18,7 +18,7 @@ #include <errno.h> #include "pthreadP.h" -#include <lowlevellock.h> +#include <futex-internal.h> #include <kernel-features.h> @@ -29,34 +29,31 @@ static const struct pthread_barrierattr default_barrierattr = int -__pthread_barrier_init (barrier, attr, count) - pthread_barrier_t *barrier; - const pthread_barrierattr_t *attr; - unsigned int count; +__pthread_barrier_init (pthread_barrier_t *barrier, + const pthread_barrierattr_t *attr, unsigned int count) { struct pthread_barrier *ibarrier; - /* XXX EINVAL is not specified by POSIX as a possible error code. */ - if (__glibc_unlikely (count == 0)) + /* XXX EINVAL is not specified by POSIX as a possible error code for COUNT + being too large. See pthread_barrier_wait for the reason for the + comparison with BARRIER_IN_THRESHOLD. */ + if (__glibc_unlikely (count == 0 || count >= BARRIER_IN_THRESHOLD)) return EINVAL; const struct pthread_barrierattr *iattr = (attr != NULL - ? iattr = (struct pthread_barrierattr *) attr + ? (struct pthread_barrierattr *) attr : &default_barrierattr); ibarrier = (struct pthread_barrier *) barrier; /* Initialize the individual fields. */ - ibarrier->lock = LLL_LOCK_INITIALIZER; - ibarrier->left = count; - ibarrier->init_count = count; - ibarrier->curr_event = 0; - - /* XXX Don't use FUTEX_SHARED or FUTEX_PRIVATE as long as there are still - assembly implementations that expect the value determined below. */ - ibarrier->private = (iattr->pshared != PTHREAD_PROCESS_PRIVATE - ? 0 : FUTEX_PRIVATE_FLAG); + ibarrier->in = 0; + ibarrier->out = 0; + ibarrier->count = count; + ibarrier->current_round = 0; + ibarrier->shared = (iattr->pshared == PTHREAD_PROCESS_PRIVATE + ? FUTEX_PRIVATE : FUTEX_SHARED); return 0; } diff --git a/nptl/pthread_barrier_wait.c b/nptl/pthread_barrier_wait.c index 2b34e3097b..eabb5099d3 100644 --- a/nptl/pthread_barrier_wait.c +++ b/nptl/pthread_barrier_wait.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003-2015 Free Software Foundation, Inc. +/* Copyright (C) 2003-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Martin Schwidefsky <schwidefsky@de.ibm.com>, 2003. @@ -18,64 +18,206 @@ #include <errno.h> #include <sysdep.h> -#include <lowlevellock.h> #include <futex-internal.h> #include <pthreadP.h> -/* Wait on barrier. */ +/* Wait on the barrier. + + In each round, we wait for a fixed number of threads to enter the barrier + (COUNT). Once that has happened, exactly these threads are allowed to + leave the barrier. Note that POSIX does not require that only COUNT + threads can attempt to block using the barrier concurrently. + + We count the number of threads that have entered (IN). Each thread + increments IN when entering, thus getting a position in the sequence of + threads that are or have been waiting (starting with 1, so the position + is the number of threads that have entered so far including the current + thread). + CURRENT_ROUND designates the most recent thread whose round has been + detected as complete. When a thread detects that enough threads have + entered to make a round complete, it finishes this round by effectively + adding COUNT to CURRENT_ROUND atomically. Threads that believe that their + round is not complete yet wait until CURRENT_ROUND is not smaller than + their position anymore. + + A barrier can be destroyed as soon as no threads are blocked on the + barrier. This is already the case if just one thread from the last round + has stopped waiting and returned to the caller; the assumption is that + all threads from the round are unblocked atomically, even though they may + return at different times from the respective calls to + pthread_barrier_wait). Thus, a valid call to pthread_barrier_destroy can + be concurrent with other threads still figuring out that their round has + been completed. Therefore, threads need to confirm that they have left + the barrier by incrementing OUT, and pthread_barrier_destroy needs to wait + until OUT equals IN. + + To avoid an ABA issue for futex_wait on CURRENT_ROUND and for archs with + 32b-only atomics, we additionally reset the barrier when IN reaches + a threshold to avoid overflow. We assume that the total number of threads + is less than UINT_MAX/2, and set the threshold accordingly so that we can + use a simple atomic_fetch_add on IN instead of a CAS when entering. The + threshold is always set to the end of a round, so all threads that have + entered are either pre-reset threads or post-reset threads (i.e., have a + position larger than the threshold). + Pre-reset threads just run the algorithm explained above. Post-reset + threads wait until IN is reset to a pre-threshold value. + When the last pre-reset thread leaves the barrier (i.e., OUT equals the + threshold), it resets the barrier to its initial state. Other (post-reset) + threads wait for the reset to have finished by waiting until IN is less + than the threshold and then restart by trying to enter the barrier again. + + We reuse the reset mechanism in pthread_barrier_destroy to get notified + when all threads have left the barrier: We trigger an artificial reset and + wait for the last pre-reset thread to finish reset, thus notifying the + thread that is about to destroy the barrier. + + Blocking using futexes is straightforward: pre-reset threads wait for + completion of their round using CURRENT_ROUND as futex word, and post-reset + threads and pthread_barrier_destroy use IN as futex word. + + Further notes: + * It is not simple to let some of the post-reset threads help with the + reset because of the ABA issues that arise; therefore, we simply make + the last thread to leave responsible for the reset. + * POSIX leaves it unspecified whether a signal handler running in a thread + that has been unblocked (because its round is complete) can stall all + other threads and prevent them from returning from the barrier. In this + implementation, other threads will return. However, + pthread_barrier_destroy will of course wait for the signal handler thread + to confirm that it left the barrier. + + TODO We should add spinning with back-off. Once we do that, we could also + try to avoid the futex_wake syscall when a round is detected as finished. + If we do not spin, it is quite likely that at least some other threads will + have called futex_wait already. */ int -__pthread_barrier_wait (barrier) - pthread_barrier_t *barrier; +__pthread_barrier_wait (pthread_barrier_t *barrier) { - struct pthread_barrier *ibarrier = (struct pthread_barrier *) barrier; - int result = 0; - int lll_private = ibarrier->private ^ FUTEX_PRIVATE_FLAG; - int futex_private = (lll_private == LLL_PRIVATE - ? FUTEX_PRIVATE : FUTEX_SHARED); - - /* Make sure we are alone. */ - lll_lock (ibarrier->lock, lll_private); - - /* One more arrival. */ - --ibarrier->left; - - /* Are these all? */ - if (ibarrier->left == 0) + struct pthread_barrier *bar = (struct pthread_barrier *) barrier; + + /* How many threads entered so far, including ourself. */ + unsigned int i; + + reset_restart: + /* Try to enter the barrier. We need acquire MO to (1) ensure that if we + observe that our round can be completed (see below for our attempt to do + so), all pre-barrier-entry effects of all threads in our round happen + before us completing the round, and (2) to make our use of the barrier + happen after a potential reset. We need release MO to make sure that our + pre-barrier-entry effects happen before threads in this round leaving the + barrier. */ + i = atomic_fetch_add_acq_rel (&bar->in, 1) + 1; + /* These loads are after the fetch_add so that we're less likely to first + pull in the cache line as shared. */ + unsigned int count = bar->count; + /* This is the number of threads that can enter before we need to reset. + Always at the end of a round. */ + unsigned int max_in_before_reset = BARRIER_IN_THRESHOLD + - BARRIER_IN_THRESHOLD % count; + + if (i > max_in_before_reset) { - /* Yes. Increment the event counter to avoid invalid wake-ups and - tell the current waiters that it is their turn. */ - ++ibarrier->curr_event; - - /* Wake up everybody. */ - futex_wake (&ibarrier->curr_event, INT_MAX, futex_private); - - /* This is the thread which finished the serialization. */ - result = PTHREAD_BARRIER_SERIAL_THREAD; + /* We're in a reset round. Just wait for a reset to finish; do not + help finishing previous rounds because this could happen + concurrently with a reset. */ + while (i > max_in_before_reset) + { + futex_wait_simple (&bar->in, i, bar->shared); + /* Relaxed MO is fine here because we just need an indication for + when we should retry to enter (which will use acquire MO, see + above). */ + i = atomic_load_relaxed (&bar->in); + } + goto reset_restart; } - else - { - /* The number of the event we are waiting for. The barrier's event - number must be bumped before we continue. */ - unsigned int event = ibarrier->curr_event; - /* Before suspending, make the barrier available to others. */ - lll_unlock (ibarrier->lock, lll_private); + /* Look at the current round. At this point, we are just interested in + whether we can complete rounds, based on the information we obtained + through our acquire-MO load of IN. Nonetheless, if we notice that + our round has been completed using this load, we use the acquire-MO + fence below to make sure that all pre-barrier-entry effects of all + threads in our round happen before us leaving the barrier. Therefore, + relaxed MO is sufficient. */ + unsigned cr = atomic_load_relaxed (&bar->current_round); + + /* Try to finish previous rounds and/or the current round. We simply + consider just our position here and do not try to do the work of threads + that entered more recently. */ + while (cr + count <= i) + { + /* Calculate the new current round based on how many threads entered. + NEWCR must be larger than CR because CR+COUNT ends a round. */ + unsigned int newcr = i - i % count; + /* Try to complete previous and/or the current round. We need release + MO to propagate the happens-before that we observed through reading + with acquire MO from IN to other threads. If the CAS fails, it + is like the relaxed-MO load of CURRENT_ROUND above. */ + if (atomic_compare_exchange_weak_release (&bar->current_round, &cr, + newcr)) + { + /* Update CR with the modification we just did. */ + cr = newcr; + /* Wake threads belonging to the rounds we just finished. We may + wake more threads than necessary if more than COUNT threads try + to block concurrently on the barrier, but this is not a typical + use of barriers. + Note that we can still access SHARED because we haven't yet + confirmed to have left the barrier. */ + futex_wake (&bar->current_round, INT_MAX, bar->shared); + /* We did as much as we could based on our position. If we advanced + the current round to a round sufficient for us, do not wait for + that to happen and skip the acquire fence (we already + synchronize-with all other threads in our round through the + initial acquire MO fetch_add of IN. */ + if (i <= cr) + goto ready_to_leave; + else + break; + } + } - /* Wait for the event counter of the barrier to change. */ - do - futex_wait_simple (&ibarrier->curr_event, event, futex_private); - while (event == ibarrier->curr_event); + /* Wait until the current round is more recent than the round we are in. */ + while (i > cr) + { + /* Wait for the current round to finish. */ + futex_wait_simple (&bar->current_round, cr, bar->shared); + /* See the fence below. */ + cr = atomic_load_relaxed (&bar->current_round); } - /* Make sure the init_count is stored locally or in a register. */ - unsigned int init_count = ibarrier->init_count; + /* Our round finished. Use the acquire MO fence to synchronize-with the + thread that finished the round, either through the initial load of + CURRENT_ROUND above or a failed CAS in the loop above. */ + atomic_thread_fence_acquire (); + + /* Now signal that we left. */ + unsigned int o; + ready_to_leave: + /* We need release MO here so that our use of the barrier happens before + reset or memory reuse after pthread_barrier_destroy. */ + o = atomic_fetch_add_release (&bar->out, 1) + 1; + if (o == max_in_before_reset) + { + /* Perform a reset if we are the last pre-reset thread leaving. All + other threads accessing the barrier are post-reset threads and are + incrementing or spinning on IN. Thus, resetting IN as the last step + of reset ensures that the reset is not concurrent with actual use of + the barrier. We need the acquire MO fence so that the reset happens + after use of the barrier by all earlier pre-reset threads. */ + atomic_thread_fence_acquire (); + atomic_store_relaxed (&bar->current_round, 0); + atomic_store_relaxed (&bar->out, 0); + /* When destroying the barrier, we wait for a reset to happen. Thus, + we must load SHARED now so that this happens before the barrier is + destroyed. */ + int shared = bar->shared; + atomic_store_release (&bar->in, 0); + futex_wake (&bar->in, INT_MAX, shared); - /* If this was the last woken thread, unlock. */ - if (atomic_increment_val (&ibarrier->left) == init_count) - /* We are done. */ - lll_unlock (ibarrier->lock, lll_private); + } - return result; + /* Return a special value for exactly one thread per round. */ + return i % count == 0 ? PTHREAD_BARRIER_SERIAL_THREAD : 0; } weak_alias (__pthread_barrier_wait, pthread_barrier_wait) diff --git a/nptl/pthread_barrierattr_destroy.c b/nptl/pthread_barrierattr_destroy.c index e953fabec8..83b06f00c4 100644 --- a/nptl/pthread_barrierattr_destroy.c +++ b/nptl/pthread_barrierattr_destroy.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -20,8 +20,7 @@ int -pthread_barrierattr_destroy (attr) - pthread_barrierattr_t *attr; +pthread_barrierattr_destroy (pthread_barrierattr_t *attr) { /* Nothing to do. */ diff --git a/nptl/pthread_barrierattr_getpshared.c b/nptl/pthread_barrierattr_getpshared.c index 174161f25b..e3214a8015 100644 --- a/nptl/pthread_barrierattr_getpshared.c +++ b/nptl/pthread_barrierattr_getpshared.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -20,9 +20,8 @@ int -pthread_barrierattr_getpshared (attr, pshared) - const pthread_barrierattr_t *attr; - int *pshared; +pthread_barrierattr_getpshared (const pthread_barrierattr_t *attr, + int *pshared) { *pshared = ((const struct pthread_barrierattr *) attr)->pshared; diff --git a/nptl/pthread_barrierattr_init.c b/nptl/pthread_barrierattr_init.c index 70a00b0eb7..31824a95f0 100644 --- a/nptl/pthread_barrierattr_init.c +++ b/nptl/pthread_barrierattr_init.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -20,8 +20,7 @@ int -pthread_barrierattr_init (attr) - pthread_barrierattr_t *attr; +pthread_barrierattr_init (pthread_barrierattr_t *attr) { ((struct pthread_barrierattr *) attr)->pshared = PTHREAD_PROCESS_PRIVATE; diff --git a/nptl/pthread_barrierattr_setpshared.c b/nptl/pthread_barrierattr_setpshared.c index eeaee5d430..d41b041e1e 100644 --- a/nptl/pthread_barrierattr_setpshared.c +++ b/nptl/pthread_barrierattr_setpshared.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -22,19 +22,13 @@ int -pthread_barrierattr_setpshared (attr, pshared) - pthread_barrierattr_t *attr; - int pshared; +pthread_barrierattr_setpshared (pthread_barrierattr_t *attr, int pshared) { - struct pthread_barrierattr *iattr; - int err = futex_supports_pshared (pshared); if (err != 0) return err; - iattr = (struct pthread_barrierattr *) attr; - - iattr->pshared = pshared; + ((struct pthread_barrierattr *) attr)->pshared = pshared; return 0; } diff --git a/nptl/pthread_cancel.c b/nptl/pthread_cancel.c index 981e4bc8f7..1419baf988 100644 --- a/nptl/pthread_cancel.c +++ b/nptl/pthread_cancel.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. diff --git a/nptl/pthread_clock_gettime.c b/nptl/pthread_clock_gettime.c index 6ef712e8bf..7e7a0c5b77 100644 --- a/nptl/pthread_clock_gettime.c +++ b/nptl/pthread_clock_gettime.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2001-2015 Free Software Foundation, Inc. +/* Copyright (C) 2001-2016 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 diff --git a/nptl/pthread_clock_settime.c b/nptl/pthread_clock_settime.c index fc60f6134b..bc79f3f82d 100644 --- a/nptl/pthread_clock_settime.c +++ b/nptl/pthread_clock_settime.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2001-2015 Free Software Foundation, Inc. +/* Copyright (C) 2001-2016 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 diff --git a/nptl/pthread_cond_broadcast.c b/nptl/pthread_cond_broadcast.c index 881d098c05..552fd42f60 100644 --- a/nptl/pthread_cond_broadcast.c +++ b/nptl/pthread_cond_broadcast.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003-2015 Free Software Foundation, Inc. +/* Copyright (C) 2003-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Martin Schwidefsky <schwidefsky@de.ibm.com>, 2003. @@ -29,8 +29,7 @@ int -__pthread_cond_broadcast (cond) - pthread_cond_t *cond; +__pthread_cond_broadcast (pthread_cond_t *cond) { LIBC_PROBE (cond_broadcast, 1, cond); diff --git a/nptl/pthread_cond_destroy.c b/nptl/pthread_cond_destroy.c index 410e52d3c0..1acd8042d8 100644 --- a/nptl/pthread_cond_destroy.c +++ b/nptl/pthread_cond_destroy.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -23,8 +23,7 @@ int -__pthread_cond_destroy (cond) - pthread_cond_t *cond; +__pthread_cond_destroy (pthread_cond_t *cond) { int pshared = (cond->__data.__mutex == (void *) ~0l) ? LLL_SHARED : LLL_PRIVATE; diff --git a/nptl/pthread_cond_init.c b/nptl/pthread_cond_init.c index ce954c7730..9023370278 100644 --- a/nptl/pthread_cond_init.c +++ b/nptl/pthread_cond_init.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -22,9 +22,7 @@ int -__pthread_cond_init (cond, cond_attr) - pthread_cond_t *cond; - const pthread_condattr_t *cond_attr; +__pthread_cond_init (pthread_cond_t *cond, const pthread_condattr_t *cond_attr) { struct pthread_condattr *icond_attr = (struct pthread_condattr *) cond_attr; diff --git a/nptl/pthread_cond_signal.c b/nptl/pthread_cond_signal.c index ba32f40532..b3a6d3d2a4 100644 --- a/nptl/pthread_cond_signal.c +++ b/nptl/pthread_cond_signal.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003-2015 Free Software Foundation, Inc. +/* Copyright (C) 2003-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Martin Schwidefsky <schwidefsky@de.ibm.com>, 2003. @@ -29,8 +29,7 @@ int -__pthread_cond_signal (cond) - pthread_cond_t *cond; +__pthread_cond_signal (pthread_cond_t *cond) { int pshared = (cond->__data.__mutex == (void *) ~0l) ? LLL_SHARED : LLL_PRIVATE; diff --git a/nptl/pthread_cond_timedwait.c b/nptl/pthread_cond_timedwait.c index 10b0a61a2a..711a51de20 100644 --- a/nptl/pthread_cond_timedwait.c +++ b/nptl/pthread_cond_timedwait.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003-2015 Free Software Foundation, Inc. +/* Copyright (C) 2003-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Martin Schwidefsky <schwidefsky@de.ibm.com>, 2003. diff --git a/nptl/pthread_cond_wait.c b/nptl/pthread_cond_wait.c index 0d6558b642..3f62acc6bd 100644 --- a/nptl/pthread_cond_wait.c +++ b/nptl/pthread_cond_wait.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003-2015 Free Software Foundation, Inc. +/* Copyright (C) 2003-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Martin Schwidefsky <schwidefsky@de.ibm.com>, 2003. diff --git a/nptl/pthread_condattr_destroy.c b/nptl/pthread_condattr_destroy.c index 55621c1a07..3c24c6a4d6 100644 --- a/nptl/pthread_condattr_destroy.c +++ b/nptl/pthread_condattr_destroy.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -20,8 +20,7 @@ int -__pthread_condattr_destroy (attr) - pthread_condattr_t *attr; +__pthread_condattr_destroy (pthread_condattr_t *attr) { /* Nothing to be done. */ return 0; diff --git a/nptl/pthread_condattr_getclock.c b/nptl/pthread_condattr_getclock.c index 020d21a816..d156302ffb 100644 --- a/nptl/pthread_condattr_getclock.c +++ b/nptl/pthread_condattr_getclock.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003-2015 Free Software Foundation, Inc. +/* Copyright (C) 2003-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2003. @@ -20,9 +20,7 @@ int -pthread_condattr_getclock (attr, clock_id) - const pthread_condattr_t *attr; - clockid_t *clock_id; +pthread_condattr_getclock (const pthread_condattr_t *attr, clockid_t *clock_id) { *clock_id = (((((const struct pthread_condattr *) attr)->value) >> 1) & ((1 << COND_NWAITERS_SHIFT) - 1)); diff --git a/nptl/pthread_condattr_getpshared.c b/nptl/pthread_condattr_getpshared.c index c4d991728d..5a10f3eeb0 100644 --- a/nptl/pthread_condattr_getpshared.c +++ b/nptl/pthread_condattr_getpshared.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -20,9 +20,7 @@ int -pthread_condattr_getpshared (attr, pshared) - const pthread_condattr_t *attr; - int *pshared; +pthread_condattr_getpshared (const pthread_condattr_t *attr, int *pshared) { *pshared = ((const struct pthread_condattr *) attr)->value & 1; diff --git a/nptl/pthread_condattr_init.c b/nptl/pthread_condattr_init.c index 5ecc5f6d59..0ce42e5dfa 100644 --- a/nptl/pthread_condattr_init.c +++ b/nptl/pthread_condattr_init.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -21,8 +21,7 @@ int -__pthread_condattr_init (attr) - pthread_condattr_t *attr; +__pthread_condattr_init (pthread_condattr_t *attr) { memset (attr, '\0', sizeof (*attr)); diff --git a/nptl/pthread_condattr_setclock.c b/nptl/pthread_condattr_setclock.c index 0748d78d05..25e2a176a0 100644 --- a/nptl/pthread_condattr_setclock.c +++ b/nptl/pthread_condattr_setclock.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003-2015 Free Software Foundation, Inc. +/* Copyright (C) 2003-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2003. @@ -25,9 +25,7 @@ int -pthread_condattr_setclock (attr, clock_id) - pthread_condattr_t *attr; - clockid_t clock_id; +pthread_condattr_setclock (pthread_condattr_t *attr, clockid_t clock_id) { /* Only a few clocks are allowed. */ if (clock_id != CLOCK_MONOTONIC && clock_id != CLOCK_REALTIME) diff --git a/nptl/pthread_condattr_setpshared.c b/nptl/pthread_condattr_setpshared.c index a015403cf5..408f8237ed 100644 --- a/nptl/pthread_condattr_setpshared.c +++ b/nptl/pthread_condattr_setpshared.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -21,9 +21,7 @@ #include <futex-internal.h> int -pthread_condattr_setpshared (attr, pshared) - pthread_condattr_t *attr; - int pshared; +pthread_condattr_setpshared (pthread_condattr_t *attr, int pshared) { int err = futex_supports_pshared (pshared); if (err != 0) diff --git a/nptl/pthread_create.c b/nptl/pthread_create.c index d10f4ea800..5216041733 100644 --- a/nptl/pthread_create.c +++ b/nptl/pthread_create.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -80,8 +80,7 @@ static int create_thread (struct pthread *pd, const struct pthread_attr *attr, struct pthread * internal_function -__find_in_stack_list (pd) - struct pthread *pd; +__find_in_stack_list (struct pthread *pd) { list_t *entry; struct pthread *result = NULL; @@ -488,11 +487,8 @@ report_thread_creation (struct pthread *pd) int -__pthread_create_2_1 (newthread, attr, start_routine, arg) - pthread_t *newthread; - const pthread_attr_t *attr; - void *(*start_routine) (void *); - void *arg; +__pthread_create_2_1 (pthread_t *newthread, const pthread_attr_t *attr, + void *(*start_routine) (void *), void *arg) { STACK_VARIABLES; @@ -724,11 +720,8 @@ versioned_symbol (libpthread, __pthread_create_2_1, pthread_create, GLIBC_2_1); #if SHLIB_COMPAT(libpthread, GLIBC_2_0, GLIBC_2_1) int -__pthread_create_2_0 (newthread, attr, start_routine, arg) - pthread_t *newthread; - const pthread_attr_t *attr; - void *(*start_routine) (void *); - void *arg; +__pthread_create_2_0 (pthread_t *newthread, const pthread_attr_t *attr, + void *(*start_routine) (void *), void *arg) { /* The ATTR attribute is not really of type `pthread_attr_t *'. It has the old size and access to the new members might crash the program. diff --git a/nptl/pthread_detach.c b/nptl/pthread_detach.c index aa735f6605..ccc44199de 100644 --- a/nptl/pthread_detach.c +++ b/nptl/pthread_detach.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -22,8 +22,7 @@ int -pthread_detach (th) - pthread_t th; +pthread_detach (pthread_t th) { struct pthread *pd = (struct pthread *) th; diff --git a/nptl/pthread_equal.c b/nptl/pthread_equal.c index 69f4c1b54f..cbc17b47d4 100644 --- a/nptl/pthread_equal.c +++ b/nptl/pthread_equal.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -20,9 +20,7 @@ int -__pthread_equal (thread1, thread2) - pthread_t thread1; - pthread_t thread2; +__pthread_equal (pthread_t thread1, pthread_t thread2) { return thread1 == thread2; } diff --git a/nptl/pthread_exit.c b/nptl/pthread_exit.c index a60adbdd38..00f97a68f0 100644 --- a/nptl/pthread_exit.c +++ b/nptl/pthread_exit.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. diff --git a/nptl/pthread_getaffinity.c b/nptl/pthread_getaffinity.c index a748bc9b4f..83680bb93b 100644 --- a/nptl/pthread_getaffinity.c +++ b/nptl/pthread_getaffinity.c @@ -1,5 +1,5 @@ /* Get the processor affinity of a thread. Stub version. - Copyright (C) 2014-2015 Free Software Foundation, Inc. + Copyright (C) 2014-2016 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 diff --git a/nptl/pthread_getattr_default_np.c b/nptl/pthread_getattr_default_np.c index f8a1342564..fc2bea6301 100644 --- a/nptl/pthread_getattr_default_np.c +++ b/nptl/pthread_getattr_default_np.c @@ -1,5 +1,5 @@ /* Get the default attributes used by pthread_create in the process. - Copyright (C) 2013-2015 Free Software Foundation, Inc. + Copyright (C) 2013-2016 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 diff --git a/nptl/pthread_getattr_np.c b/nptl/pthread_getattr_np.c index 52a4602730..8207cdca7b 100644 --- a/nptl/pthread_getattr_np.c +++ b/nptl/pthread_getattr_np.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -30,9 +30,7 @@ int -pthread_getattr_np (thread_id, attr) - pthread_t thread_id; - pthread_attr_t *attr; +pthread_getattr_np (pthread_t thread_id, pthread_attr_t *attr) { struct pthread *thread = (struct pthread *) thread_id; struct pthread_attr *iattr = (struct pthread_attr *) attr; diff --git a/nptl/pthread_getconcurrency.c b/nptl/pthread_getconcurrency.c index 7f2902e5f2..5eb50adf08 100644 --- a/nptl/pthread_getconcurrency.c +++ b/nptl/pthread_getconcurrency.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. diff --git a/nptl/pthread_getcpuclockid.c b/nptl/pthread_getcpuclockid.c index 33f9f7fd17..8505ad686c 100644 --- a/nptl/pthread_getcpuclockid.c +++ b/nptl/pthread_getcpuclockid.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000-2015 Free Software Foundation, Inc. +/* Copyright (C) 2000-2016 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 @@ -22,9 +22,7 @@ int -pthread_getcpuclockid (threadid, clockid) - pthread_t threadid; - clockid_t *clockid; +pthread_getcpuclockid (pthread_t threadid, clockid_t *clockid) { struct pthread *pd = (struct pthread *) threadid; diff --git a/nptl/pthread_getname.c b/nptl/pthread_getname.c index 30e0875578..80ee38a1b9 100644 --- a/nptl/pthread_getname.c +++ b/nptl/pthread_getname.c @@ -1,5 +1,5 @@ /* pthread_getname_np -- Get thread name. Stub version. - Copyright (C) 2014-2015 Free Software Foundation, Inc. + Copyright (C) 2014-2016 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 diff --git a/nptl/pthread_getschedparam.c b/nptl/pthread_getschedparam.c index 5de8924007..b887881baf 100644 --- a/nptl/pthread_getschedparam.c +++ b/nptl/pthread_getschedparam.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -23,10 +23,8 @@ int -__pthread_getschedparam (threadid, policy, param) - pthread_t threadid; - int *policy; - struct sched_param *param; +__pthread_getschedparam (pthread_t threadid, int *policy, + struct sched_param *param) { struct pthread *pd = (struct pthread *) threadid; diff --git a/nptl/pthread_getspecific.c b/nptl/pthread_getspecific.c index 0bee354817..b6a5068437 100644 --- a/nptl/pthread_getspecific.c +++ b/nptl/pthread_getspecific.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -21,8 +21,7 @@ void * -__pthread_getspecific (key) - pthread_key_t key; +__pthread_getspecific (pthread_key_t key) { struct pthread_key_data *data; diff --git a/nptl/pthread_join.c b/nptl/pthread_join.c index c841ff917b..6a7405e47f 100644 --- a/nptl/pthread_join.c +++ b/nptl/pthread_join.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. diff --git a/nptl/pthread_key_create.c b/nptl/pthread_key_create.c index a642c6929f..66938b914c 100644 --- a/nptl/pthread_key_create.c +++ b/nptl/pthread_key_create.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -22,9 +22,7 @@ int -__pthread_key_create (key, destr) - pthread_key_t *key; - void (*destr) (void *); +__pthread_key_create (pthread_key_t *key, void (*destr) (void *)) { /* Find a slot in __pthread_keys which is unused. */ for (size_t cnt = 0; cnt < PTHREAD_KEYS_MAX; ++cnt) diff --git a/nptl/pthread_key_delete.c b/nptl/pthread_key_delete.c index bd9b4a2aba..81ae20d167 100644 --- a/nptl/pthread_key_delete.c +++ b/nptl/pthread_key_delete.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -22,8 +22,7 @@ int -pthread_key_delete (key) - pthread_key_t key; +pthread_key_delete (pthread_key_t key) { int result = EINVAL; diff --git a/nptl/pthread_kill.c b/nptl/pthread_kill.c index bb0e1f4bdb..2e5cd0f1e7 100644 --- a/nptl/pthread_kill.c +++ b/nptl/pthread_kill.c @@ -1,5 +1,5 @@ /* Send a signal to a specific pthread. Stub version. - Copyright (C) 2014-2015 Free Software Foundation, Inc. + Copyright (C) 2014-2016 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 diff --git a/nptl/pthread_kill_other_threads.c b/nptl/pthread_kill_other_threads.c index 1cc6359977..a5423fee90 100644 --- a/nptl/pthread_kill_other_threads.c +++ b/nptl/pthread_kill_other_threads.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. diff --git a/nptl/pthread_mutex_cond_lock.c b/nptl/pthread_mutex_cond_lock.c index 7b6fbc18aa..2ac421fd63 100644 --- a/nptl/pthread_mutex_cond_lock.c +++ b/nptl/pthread_mutex_cond_lock.c @@ -14,7 +14,7 @@ #define LLL_ROBUST_MUTEX_LOCK(mutex, id) \ lll_robust_cond_lock ((mutex)->__data.__lock, id, \ PTHREAD_ROBUST_MUTEX_PSHARED (mutex)) -#define __pthread_mutex_lock __pthread_mutex_cond_lock +#define __pthread_mutex_lock internal_function __pthread_mutex_cond_lock #define __pthread_mutex_lock_full __pthread_mutex_cond_lock_full #define NO_INCR diff --git a/nptl/pthread_mutex_consistent.c b/nptl/pthread_mutex_consistent.c index b8dbe03573..944ab2a776 100644 --- a/nptl/pthread_mutex_consistent.c +++ b/nptl/pthread_mutex_consistent.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2005-2015 Free Software Foundation, Inc. +/* Copyright (C) 2005-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2005. @@ -21,8 +21,7 @@ int -pthread_mutex_consistent (mutex) - pthread_mutex_t *mutex; +pthread_mutex_consistent (pthread_mutex_t *mutex) { /* Test whether this is a robust mutex with a dead owner. */ if ((mutex->__data.__kind & PTHREAD_MUTEX_ROBUST_NORMAL_NP) == 0 diff --git a/nptl/pthread_mutex_destroy.c b/nptl/pthread_mutex_destroy.c index f6089df1d3..8a57d49272 100644 --- a/nptl/pthread_mutex_destroy.c +++ b/nptl/pthread_mutex_destroy.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -23,8 +23,7 @@ int -__pthread_mutex_destroy (mutex) - pthread_mutex_t *mutex; +__pthread_mutex_destroy (pthread_mutex_t *mutex) { LIBC_PROBE (mutex_destroy, 1, mutex); diff --git a/nptl/pthread_mutex_getprioceiling.c b/nptl/pthread_mutex_getprioceiling.c index 43c35fb4cd..54522fc9c3 100644 --- a/nptl/pthread_mutex_getprioceiling.c +++ b/nptl/pthread_mutex_getprioceiling.c @@ -1,5 +1,5 @@ /* Get current priority ceiling of pthread_mutex_t. - Copyright (C) 2006-2015 Free Software Foundation, Inc. + Copyright (C) 2006-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Jakub Jelinek <jakub@redhat.com>, 2006. @@ -22,9 +22,7 @@ int -pthread_mutex_getprioceiling (mutex, prioceiling) - const pthread_mutex_t *mutex; - int *prioceiling; +pthread_mutex_getprioceiling (const pthread_mutex_t *mutex, int *prioceiling) { if (__builtin_expect ((mutex->__data.__kind & PTHREAD_MUTEX_PRIO_PROTECT_NP) == 0, 0)) diff --git a/nptl/pthread_mutex_init.c b/nptl/pthread_mutex_init.c index d71cfef0f7..71ac7bc7f3 100644 --- a/nptl/pthread_mutex_init.c +++ b/nptl/pthread_mutex_init.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -55,9 +55,8 @@ prio_inherit_missing (void) } int -__pthread_mutex_init (mutex, mutexattr) - pthread_mutex_t *mutex; - const pthread_mutexattr_t *mutexattr; +__pthread_mutex_init (pthread_mutex_t *mutex, + const pthread_mutexattr_t *mutexattr) { const struct pthread_mutexattr *imutexattr; diff --git a/nptl/pthread_mutex_lock.c b/nptl/pthread_mutex_lock.c index 9a3b46624d..bdfa529f63 100644 --- a/nptl/pthread_mutex_lock.c +++ b/nptl/pthread_mutex_lock.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -60,8 +60,7 @@ static int __pthread_mutex_lock_full (pthread_mutex_t *mutex) __attribute_noinline__; int -__pthread_mutex_lock (mutex) - pthread_mutex_t *mutex; +__pthread_mutex_lock (pthread_mutex_t *mutex) { assert (sizeof (mutex->__size) >= sizeof (mutex->__data)); @@ -521,8 +520,8 @@ hidden_def (__pthread_mutex_lock) #ifdef NO_INCR void -__pthread_mutex_cond_lock_adjust (mutex) - pthread_mutex_t *mutex; +internal_function +__pthread_mutex_cond_lock_adjust (pthread_mutex_t *mutex) { assert ((mutex->__data.__kind & PTHREAD_MUTEX_PRIO_INHERIT_NP) != 0); assert ((mutex->__data.__kind & PTHREAD_MUTEX_ROBUST_NORMAL_NP) == 0); diff --git a/nptl/pthread_mutex_setprioceiling.c b/nptl/pthread_mutex_setprioceiling.c index 1be7471c91..6b98b5d046 100644 --- a/nptl/pthread_mutex_setprioceiling.c +++ b/nptl/pthread_mutex_setprioceiling.c @@ -1,5 +1,5 @@ /* Set current priority ceiling of pthread_mutex_t. - Copyright (C) 2006-2015 Free Software Foundation, Inc. + Copyright (C) 2006-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Jakub Jelinek <jakub@redhat.com>, 2006. @@ -24,10 +24,8 @@ int -pthread_mutex_setprioceiling (mutex, prioceiling, old_ceiling) - pthread_mutex_t *mutex; - int prioceiling; - int *old_ceiling; +pthread_mutex_setprioceiling (pthread_mutex_t *mutex, int prioceiling, + int *old_ceiling) { /* The low bits of __kind aren't ever changed after pthread_mutex_init, so we don't need a lock yet. */ diff --git a/nptl/pthread_mutex_timedlock.c b/nptl/pthread_mutex_timedlock.c index f0fb03e90b..07f0901e52 100644 --- a/nptl/pthread_mutex_timedlock.c +++ b/nptl/pthread_mutex_timedlock.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -41,9 +41,8 @@ #endif int -pthread_mutex_timedlock (mutex, abstime) - pthread_mutex_t *mutex; - const struct timespec *abstime; +pthread_mutex_timedlock (pthread_mutex_t *mutex, + const struct timespec *abstime) { int oldval; pid_t id = THREAD_GETMEM (THREAD_SELF, tid); @@ -90,7 +89,8 @@ pthread_mutex_timedlock (mutex, abstime) if (__glibc_unlikely (mutex->__data.__owner == id)) return EDEADLK; - /* FALLTHROUGH */ + /* Don't do lock elision on an error checking mutex. */ + goto simple; case PTHREAD_MUTEX_TIMED_NP: FORCE_ELISION (mutex, goto elision); diff --git a/nptl/pthread_mutex_trylock.c b/nptl/pthread_mutex_trylock.c index 33df384bd0..48c7865702 100644 --- a/nptl/pthread_mutex_trylock.c +++ b/nptl/pthread_mutex_trylock.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -31,8 +31,7 @@ #endif int -__pthread_mutex_trylock (mutex) - pthread_mutex_t *mutex; +__pthread_mutex_trylock (pthread_mutex_t *mutex) { int oldval; pid_t id = THREAD_GETMEM (THREAD_SELF, tid); diff --git a/nptl/pthread_mutex_unlock.c b/nptl/pthread_mutex_unlock.c index 80939ba8b0..334ce38342 100644 --- a/nptl/pthread_mutex_unlock.c +++ b/nptl/pthread_mutex_unlock.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -24,7 +24,7 @@ #include <stap-probe.h> #ifndef lll_unlock_elision -#define lll_unlock_elision(a,b) ({ lll_unlock (a,b); 0; }) +#define lll_unlock_elision(a,b,c) ({ lll_unlock (a,c); 0; }) #endif static int @@ -34,9 +34,7 @@ __pthread_mutex_unlock_full (pthread_mutex_t *mutex, int decr) int internal_function attribute_hidden -__pthread_mutex_unlock_usercnt (mutex, decr) - pthread_mutex_t *mutex; - int decr; +__pthread_mutex_unlock_usercnt (pthread_mutex_t *mutex, int decr) { int type = PTHREAD_MUTEX_TYPE_ELISION (mutex); if (__builtin_expect (type & @@ -63,7 +61,7 @@ __pthread_mutex_unlock_usercnt (mutex, decr) else if (__glibc_likely (type == PTHREAD_MUTEX_TIMED_ELISION_NP)) { /* Don't reset the owner/users fields for elision. */ - return lll_unlock_elision (mutex->__data.__lock, + return lll_unlock_elision (mutex->__data.__lock, mutex->__data.__elision, PTHREAD_MUTEX_PSHARED (mutex)); } else if (__builtin_expect (PTHREAD_MUTEX_TYPE (mutex) @@ -232,16 +230,18 @@ __pthread_mutex_unlock_full (pthread_mutex_t *mutex, int decr) /* One less user. */ --mutex->__data.__nusers; - /* Unlock. */ + /* Unlock. Load all necessary mutex data before releasing the mutex + to not violate the mutex destruction requirements (see + lll_unlock). */ + int robust = mutex->__data.__kind & PTHREAD_MUTEX_ROBUST_NORMAL_NP; + int private = (robust + ? PTHREAD_ROBUST_MUTEX_PSHARED (mutex) + : PTHREAD_MUTEX_PSHARED (mutex)); if ((mutex->__data.__lock & FUTEX_WAITERS) != 0 || atomic_compare_and_exchange_bool_rel (&mutex->__data.__lock, 0, THREAD_GETMEM (THREAD_SELF, tid))) { - int robust = mutex->__data.__kind & PTHREAD_MUTEX_ROBUST_NORMAL_NP; - int private = (robust - ? PTHREAD_ROBUST_MUTEX_PSHARED (mutex) - : PTHREAD_MUTEX_PSHARED (mutex)); INTERNAL_SYSCALL_DECL (__err); INTERNAL_SYSCALL (futex, __err, 2, &mutex->__data.__lock, __lll_private_flag (FUTEX_UNLOCK_PI, private)); @@ -309,8 +309,7 @@ __pthread_mutex_unlock_full (pthread_mutex_t *mutex, int decr) int -__pthread_mutex_unlock (mutex) - pthread_mutex_t *mutex; +__pthread_mutex_unlock (pthread_mutex_t *mutex) { return __pthread_mutex_unlock_usercnt (mutex, 1); } diff --git a/nptl/pthread_mutexattr_destroy.c b/nptl/pthread_mutexattr_destroy.c index 28ca5fbffc..3b84d4a957 100644 --- a/nptl/pthread_mutexattr_destroy.c +++ b/nptl/pthread_mutexattr_destroy.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -20,8 +20,7 @@ int -__pthread_mutexattr_destroy (attr) - pthread_mutexattr_t *attr; +__pthread_mutexattr_destroy (pthread_mutexattr_t *attr) { return 0; } diff --git a/nptl/pthread_mutexattr_getprioceiling.c b/nptl/pthread_mutexattr_getprioceiling.c index 2f73ea276c..ee940efdd4 100644 --- a/nptl/pthread_mutexattr_getprioceiling.c +++ b/nptl/pthread_mutexattr_getprioceiling.c @@ -1,5 +1,5 @@ /* Get priority ceiling setting from pthread_mutexattr_t. - Copyright (C) 2006-2015 Free Software Foundation, Inc. + Copyright (C) 2006-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Jakub Jelinek <jakub@redhat.com>, 2006. @@ -22,9 +22,8 @@ int -pthread_mutexattr_getprioceiling (attr, prioceiling) - const pthread_mutexattr_t *attr; - int *prioceiling; +pthread_mutexattr_getprioceiling (const pthread_mutexattr_t *attr, + int *prioceiling) { const struct pthread_mutexattr *iattr; int ceiling; diff --git a/nptl/pthread_mutexattr_getprotocol.c b/nptl/pthread_mutexattr_getprotocol.c index 9914829933..9ce325b659 100644 --- a/nptl/pthread_mutexattr_getprotocol.c +++ b/nptl/pthread_mutexattr_getprotocol.c @@ -1,5 +1,5 @@ /* Get priority protocol setting from pthread_mutexattr_t. - Copyright (C) 2006-2015 Free Software Foundation, Inc. + Copyright (C) 2006-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Jakub Jelinek <jakub@redhat.com>, 2006. @@ -21,9 +21,7 @@ int -pthread_mutexattr_getprotocol (attr, protocol) - const pthread_mutexattr_t *attr; - int *protocol; +pthread_mutexattr_getprotocol (const pthread_mutexattr_t *attr, int *protocol) { const struct pthread_mutexattr *iattr; diff --git a/nptl/pthread_mutexattr_getpshared.c b/nptl/pthread_mutexattr_getpshared.c index 92840efe26..534bf70794 100644 --- a/nptl/pthread_mutexattr_getpshared.c +++ b/nptl/pthread_mutexattr_getpshared.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -20,9 +20,7 @@ int -pthread_mutexattr_getpshared (attr, pshared) - const pthread_mutexattr_t *attr; - int *pshared; +pthread_mutexattr_getpshared (const pthread_mutexattr_t *attr, int *pshared) { const struct pthread_mutexattr *iattr; diff --git a/nptl/pthread_mutexattr_getrobust.c b/nptl/pthread_mutexattr_getrobust.c index 5115e1e13a..7b8db39d65 100644 --- a/nptl/pthread_mutexattr_getrobust.c +++ b/nptl/pthread_mutexattr_getrobust.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2005-2015 Free Software Foundation, Inc. +/* Copyright (C) 2005-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2005. @@ -20,9 +20,7 @@ int -pthread_mutexattr_getrobust (attr, robustness) - const pthread_mutexattr_t *attr; - int *robustness; +pthread_mutexattr_getrobust (const pthread_mutexattr_t *attr, int *robustness) { const struct pthread_mutexattr *iattr; diff --git a/nptl/pthread_mutexattr_gettype.c b/nptl/pthread_mutexattr_gettype.c index 0bf2c82813..5c361dfc59 100644 --- a/nptl/pthread_mutexattr_gettype.c +++ b/nptl/pthread_mutexattr_gettype.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -20,9 +20,7 @@ int -pthread_mutexattr_gettype (attr, kind) - const pthread_mutexattr_t *attr; - int *kind; +pthread_mutexattr_gettype (const pthread_mutexattr_t *attr, int *kind) { const struct pthread_mutexattr *iattr; diff --git a/nptl/pthread_mutexattr_init.c b/nptl/pthread_mutexattr_init.c index 92206b0108..b3ee7057eb 100644 --- a/nptl/pthread_mutexattr_init.c +++ b/nptl/pthread_mutexattr_init.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -21,8 +21,7 @@ int -__pthread_mutexattr_init (attr) - pthread_mutexattr_t *attr; +__pthread_mutexattr_init (pthread_mutexattr_t *attr) { if (sizeof (struct pthread_mutexattr) != sizeof (pthread_mutexattr_t)) memset (attr, '\0', sizeof (*attr)); diff --git a/nptl/pthread_mutexattr_setprioceiling.c b/nptl/pthread_mutexattr_setprioceiling.c index fcd4190faa..ac7cfc5aba 100644 --- a/nptl/pthread_mutexattr_setprioceiling.c +++ b/nptl/pthread_mutexattr_setprioceiling.c @@ -1,5 +1,5 @@ /* Change priority ceiling setting in pthread_mutexattr_t. - Copyright (C) 2006-2015 Free Software Foundation, Inc. + Copyright (C) 2006-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Jakub Jelinek <jakub@redhat.com>, 2006. @@ -23,9 +23,7 @@ int -pthread_mutexattr_setprioceiling (attr, prioceiling) - pthread_mutexattr_t *attr; - int prioceiling; +pthread_mutexattr_setprioceiling (pthread_mutexattr_t *attr, int prioceiling) { /* See __init_sched_fifo_prio. */ if (atomic_load_relaxed (&__sched_fifo_min_prio) == -1 diff --git a/nptl/pthread_mutexattr_setprotocol.c b/nptl/pthread_mutexattr_setprotocol.c index b6bb92bf5d..dfaf9bea0e 100644 --- a/nptl/pthread_mutexattr_setprotocol.c +++ b/nptl/pthread_mutexattr_setprotocol.c @@ -1,5 +1,5 @@ /* Change priority protocol setting in pthread_mutexattr_t. - Copyright (C) 2006-2015 Free Software Foundation, Inc. + Copyright (C) 2006-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Jakub Jelinek <jakub@redhat.com>, 2006. @@ -22,9 +22,7 @@ int -pthread_mutexattr_setprotocol (attr, protocol) - pthread_mutexattr_t *attr; - int protocol; +pthread_mutexattr_setprotocol (pthread_mutexattr_t *attr, int protocol) { if (protocol != PTHREAD_PRIO_NONE && protocol != PTHREAD_PRIO_INHERIT diff --git a/nptl/pthread_mutexattr_setpshared.c b/nptl/pthread_mutexattr_setpshared.c index 62fd168265..269f462263 100644 --- a/nptl/pthread_mutexattr_setpshared.c +++ b/nptl/pthread_mutexattr_setpshared.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -22,9 +22,7 @@ int -pthread_mutexattr_setpshared (attr, pshared) - pthread_mutexattr_t *attr; - int pshared; +pthread_mutexattr_setpshared (pthread_mutexattr_t *attr, int pshared) { struct pthread_mutexattr *iattr; diff --git a/nptl/pthread_mutexattr_setrobust.c b/nptl/pthread_mutexattr_setrobust.c index 54d362404d..1cfb4eb803 100644 --- a/nptl/pthread_mutexattr_setrobust.c +++ b/nptl/pthread_mutexattr_setrobust.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2005-2015 Free Software Foundation, Inc. +/* Copyright (C) 2005-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2005. @@ -21,9 +21,7 @@ int -pthread_mutexattr_setrobust (attr, robustness) - pthread_mutexattr_t *attr; - int robustness; +pthread_mutexattr_setrobust (pthread_mutexattr_t *attr, int robustness) { if (robustness != PTHREAD_MUTEX_STALLED_NP && __builtin_expect (robustness != PTHREAD_MUTEX_ROBUST_NP, 0)) diff --git a/nptl/pthread_mutexattr_settype.c b/nptl/pthread_mutexattr_settype.c index c6bd5a6336..a62a81b6d2 100644 --- a/nptl/pthread_mutexattr_settype.c +++ b/nptl/pthread_mutexattr_settype.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -21,9 +21,7 @@ int -__pthread_mutexattr_settype (attr, kind) - pthread_mutexattr_t *attr; - int kind; +__pthread_mutexattr_settype (pthread_mutexattr_t *attr, int kind) { struct pthread_mutexattr *iattr; diff --git a/nptl/pthread_once.c b/nptl/pthread_once.c index 3c5bc33622..beaeb79ef8 100644 --- a/nptl/pthread_once.c +++ b/nptl/pthread_once.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003-2015 Free Software Foundation, Inc. +/* Copyright (C) 2003-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Jakub Jelinek <jakub@redhat.com>, 2003. diff --git a/nptl/pthread_rwlock_destroy.c b/nptl/pthread_rwlock_destroy.c index 7faf0c3757..88414722fb 100644 --- a/nptl/pthread_rwlock_destroy.c +++ b/nptl/pthread_rwlock_destroy.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -21,8 +21,7 @@ int -__pthread_rwlock_destroy (rwlock) - pthread_rwlock_t *rwlock; +__pthread_rwlock_destroy (pthread_rwlock_t *rwlock) { LIBC_PROBE (rwlock_destroy, 1, rwlock); diff --git a/nptl/pthread_rwlock_init.c b/nptl/pthread_rwlock_init.c index 99ab5e35cb..ba289156f1 100644 --- a/nptl/pthread_rwlock_init.c +++ b/nptl/pthread_rwlock_init.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -29,9 +29,8 @@ static const struct pthread_rwlockattr default_rwlockattr = int -__pthread_rwlock_init (rwlock, attr) - pthread_rwlock_t *rwlock; - const pthread_rwlockattr_t *attr; +__pthread_rwlock_init (pthread_rwlock_t *rwlock, + const pthread_rwlockattr_t *attr) { const struct pthread_rwlockattr *iattr; diff --git a/nptl/pthread_rwlock_rdlock.c b/nptl/pthread_rwlock_rdlock.c index eb7ac8d226..395f5575ea 100644 --- a/nptl/pthread_rwlock_rdlock.c +++ b/nptl/pthread_rwlock_rdlock.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003-2015 Free Software Foundation, Inc. +/* Copyright (C) 2003-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Martin Schwidefsky <schwidefsky@de.ibm.com>, 2003. diff --git a/nptl/pthread_rwlock_timedrdlock.c b/nptl/pthread_rwlock_timedrdlock.c index 93d235e9e1..392ba074a8 100644 --- a/nptl/pthread_rwlock_timedrdlock.c +++ b/nptl/pthread_rwlock_timedrdlock.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003-2015 Free Software Foundation, Inc. +/* Copyright (C) 2003-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Martin Schwidefsky <schwidefsky@de.ibm.com>, 2003. @@ -28,9 +28,8 @@ /* Try to acquire read lock for RWLOCK or return after specfied time. */ int -pthread_rwlock_timedrdlock (rwlock, abstime) - pthread_rwlock_t *rwlock; - const struct timespec *abstime; +pthread_rwlock_timedrdlock (pthread_rwlock_t *rwlock, + const struct timespec *abstime) { int result = 0; bool wake = false; diff --git a/nptl/pthread_rwlock_timedwrlock.c b/nptl/pthread_rwlock_timedwrlock.c index 615623a75d..67ad8c5e70 100644 --- a/nptl/pthread_rwlock_timedwrlock.c +++ b/nptl/pthread_rwlock_timedwrlock.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003-2015 Free Software Foundation, Inc. +/* Copyright (C) 2003-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Martin Schwidefsky <schwidefsky@de.ibm.com>, 2003. @@ -28,9 +28,8 @@ /* Try to acquire write lock for RWLOCK or return after specfied time. */ int -pthread_rwlock_timedwrlock (rwlock, abstime) - pthread_rwlock_t *rwlock; - const struct timespec *abstime; +pthread_rwlock_timedwrlock (pthread_rwlock_t *rwlock, + const struct timespec *abstime) { int result = 0; bool wake_readers = false; diff --git a/nptl/pthread_rwlock_tryrdlock.c b/nptl/pthread_rwlock_tryrdlock.c index 256188a14a..954fc29d9f 100644 --- a/nptl/pthread_rwlock_tryrdlock.c +++ b/nptl/pthread_rwlock_tryrdlock.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. diff --git a/nptl/pthread_rwlock_trywrlock.c b/nptl/pthread_rwlock_trywrlock.c index 918a8f28da..9959b2125d 100644 --- a/nptl/pthread_rwlock_trywrlock.c +++ b/nptl/pthread_rwlock_trywrlock.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. diff --git a/nptl/pthread_rwlock_unlock.c b/nptl/pthread_rwlock_unlock.c index bdd115d6bd..a6cadd491d 100644 --- a/nptl/pthread_rwlock_unlock.c +++ b/nptl/pthread_rwlock_unlock.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003-2015 Free Software Foundation, Inc. +/* Copyright (C) 2003-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Martin Schwidefsky <schwidefsky@de.ibm.com>, 2003. diff --git a/nptl/pthread_rwlock_wrlock.c b/nptl/pthread_rwlock_wrlock.c index 60fa909340..f061128ff6 100644 --- a/nptl/pthread_rwlock_wrlock.c +++ b/nptl/pthread_rwlock_wrlock.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003-2015 Free Software Foundation, Inc. +/* Copyright (C) 2003-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Martin Schwidefsky <schwidefsky@de.ibm.com>, 2003. diff --git a/nptl/pthread_rwlockattr_destroy.c b/nptl/pthread_rwlockattr_destroy.c index 3e2e26d915..707186841a 100644 --- a/nptl/pthread_rwlockattr_destroy.c +++ b/nptl/pthread_rwlockattr_destroy.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -20,8 +20,7 @@ int -pthread_rwlockattr_destroy (attr) - pthread_rwlockattr_t *attr; +pthread_rwlockattr_destroy (pthread_rwlockattr_t *attr) { /* Nothing to do. For now. */ diff --git a/nptl/pthread_rwlockattr_getkind_np.c b/nptl/pthread_rwlockattr_getkind_np.c index 972bd569ed..692bec6d7f 100644 --- a/nptl/pthread_rwlockattr_getkind_np.c +++ b/nptl/pthread_rwlockattr_getkind_np.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -20,9 +20,7 @@ int -pthread_rwlockattr_getkind_np (attr, pref) - const pthread_rwlockattr_t *attr; - int *pref; +pthread_rwlockattr_getkind_np (const pthread_rwlockattr_t *attr, int *pref) { *pref = ((const struct pthread_rwlockattr *) attr)->lockkind; diff --git a/nptl/pthread_rwlockattr_getpshared.c b/nptl/pthread_rwlockattr_getpshared.c index 528dc84860..d32f811fe9 100644 --- a/nptl/pthread_rwlockattr_getpshared.c +++ b/nptl/pthread_rwlockattr_getpshared.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -20,9 +20,7 @@ int -pthread_rwlockattr_getpshared (attr, pshared) - const pthread_rwlockattr_t *attr; - int *pshared; +pthread_rwlockattr_getpshared (const pthread_rwlockattr_t *attr, int *pshared) { *pshared = ((const struct pthread_rwlockattr *) attr)->pshared; diff --git a/nptl/pthread_rwlockattr_init.c b/nptl/pthread_rwlockattr_init.c index 33b060aa9f..39e3673384 100644 --- a/nptl/pthread_rwlockattr_init.c +++ b/nptl/pthread_rwlockattr_init.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -20,8 +20,7 @@ int -pthread_rwlockattr_init (attr) - pthread_rwlockattr_t *attr; +pthread_rwlockattr_init (pthread_rwlockattr_t *attr) { struct pthread_rwlockattr *iattr; diff --git a/nptl/pthread_rwlockattr_setkind_np.c b/nptl/pthread_rwlockattr_setkind_np.c index 4293c12bb8..18a6719ab9 100644 --- a/nptl/pthread_rwlockattr_setkind_np.c +++ b/nptl/pthread_rwlockattr_setkind_np.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -21,9 +21,7 @@ int -pthread_rwlockattr_setkind_np (attr, pref) - pthread_rwlockattr_t *attr; - int pref; +pthread_rwlockattr_setkind_np (pthread_rwlockattr_t *attr, int pref) { struct pthread_rwlockattr *iattr; diff --git a/nptl/pthread_rwlockattr_setpshared.c b/nptl/pthread_rwlockattr_setpshared.c index 0369209a94..6684b32eb5 100644 --- a/nptl/pthread_rwlockattr_setpshared.c +++ b/nptl/pthread_rwlockattr_setpshared.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -22,9 +22,7 @@ int -pthread_rwlockattr_setpshared (attr, pshared) - pthread_rwlockattr_t *attr; - int pshared; +pthread_rwlockattr_setpshared (pthread_rwlockattr_t *attr, int pshared) { struct pthread_rwlockattr *iattr; diff --git a/nptl/pthread_self.c b/nptl/pthread_self.c index d6ba45c9ce..cc2be1ee56 100644 --- a/nptl/pthread_self.c +++ b/nptl/pthread_self.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. diff --git a/nptl/pthread_setaffinity.c b/nptl/pthread_setaffinity.c index 59204ac4ea..75a0856fc4 100644 --- a/nptl/pthread_setaffinity.c +++ b/nptl/pthread_setaffinity.c @@ -1,5 +1,5 @@ /* Set the processor affinity of a thread. Stub version. - Copyright (C) 2014-2015 Free Software Foundation, Inc. + Copyright (C) 2014-2016 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 diff --git a/nptl/pthread_setattr_default_np.c b/nptl/pthread_setattr_default_np.c index 457a467df8..c8488d62aa 100644 --- a/nptl/pthread_setattr_default_np.c +++ b/nptl/pthread_setattr_default_np.c @@ -1,5 +1,5 @@ /* Set the default attributes to be used by pthread_create in the process. - Copyright (C) 2013-2015 Free Software Foundation, Inc. + Copyright (C) 2013-2016 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 <pthreadP.h> #include <assert.h> #include <string.h> -#include <check-cpuset.h> int @@ -48,10 +47,6 @@ pthread_setattr_default_np (const pthread_attr_t *in) return ret; } - ret = check_cpuset_attr (real_in->cpuset, real_in->cpusetsize); - if (ret) - return ret; - /* stacksize == 0 is fine. It means that we don't change the current value. */ if (real_in->stacksize != 0) diff --git a/nptl/pthread_setcancelstate.c b/nptl/pthread_setcancelstate.c index 1807789caa..b54cf6129d 100644 --- a/nptl/pthread_setcancelstate.c +++ b/nptl/pthread_setcancelstate.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -22,9 +22,7 @@ int -__pthread_setcancelstate (state, oldstate) - int state; - int *oldstate; +__pthread_setcancelstate (int state, int *oldstate) { volatile struct pthread *self; @@ -70,3 +68,4 @@ __pthread_setcancelstate (state, oldstate) return 0; } strong_alias (__pthread_setcancelstate, pthread_setcancelstate) +hidden_def (__pthread_setcancelstate) diff --git a/nptl/pthread_setcanceltype.c b/nptl/pthread_setcanceltype.c index 11eff86bb8..442211cd81 100644 --- a/nptl/pthread_setcanceltype.c +++ b/nptl/pthread_setcanceltype.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -22,9 +22,7 @@ int -__pthread_setcanceltype (type, oldtype) - int type; - int *oldtype; +__pthread_setcanceltype (int type, int *oldtype) { if (type < PTHREAD_CANCEL_DEFERRED || type > PTHREAD_CANCEL_ASYNCHRONOUS) return EINVAL; diff --git a/nptl/pthread_setconcurrency.c b/nptl/pthread_setconcurrency.c index 5b03af6a09..582b745675 100644 --- a/nptl/pthread_setconcurrency.c +++ b/nptl/pthread_setconcurrency.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -25,8 +25,7 @@ int __concurrency_level; int -pthread_setconcurrency (level) - int level; +pthread_setconcurrency (int level) { if (level < 0) return EINVAL; diff --git a/nptl/pthread_setname.c b/nptl/pthread_setname.c index 9ce114780f..6dfcbbe718 100644 --- a/nptl/pthread_setname.c +++ b/nptl/pthread_setname.c @@ -1,5 +1,5 @@ /* pthread_setname_np -- Set thread name. Stub version. - Copyright (C) 2014-2015 Free Software Foundation, Inc. + Copyright (C) 2014-2016 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 diff --git a/nptl/pthread_setschedparam.c b/nptl/pthread_setschedparam.c index 41a629df93..dfb52b9dbf 100644 --- a/nptl/pthread_setschedparam.c +++ b/nptl/pthread_setschedparam.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -24,10 +24,8 @@ int -__pthread_setschedparam (threadid, policy, param) - pthread_t threadid; - int policy; - const struct sched_param *param; +__pthread_setschedparam (pthread_t threadid, int policy, + const struct sched_param *param) { struct pthread *pd = (struct pthread *) threadid; diff --git a/nptl/pthread_setschedprio.c b/nptl/pthread_setschedprio.c index b628822472..cefc6481d6 100644 --- a/nptl/pthread_setschedprio.c +++ b/nptl/pthread_setschedprio.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -25,9 +25,7 @@ int -pthread_setschedprio (threadid, prio) - pthread_t threadid; - int prio; +pthread_setschedprio (pthread_t threadid, int prio) { struct pthread *pd = (struct pthread *) threadid; diff --git a/nptl/pthread_setspecific.c b/nptl/pthread_setspecific.c index a9cf26c195..965d463672 100644 --- a/nptl/pthread_setspecific.c +++ b/nptl/pthread_setspecific.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -22,9 +22,7 @@ int -__pthread_setspecific (key, value) - pthread_key_t key; - const void *value; +__pthread_setspecific (pthread_key_t key, const void *value) { struct pthread *self; unsigned int idx1st; diff --git a/nptl/pthread_sigmask.c b/nptl/pthread_sigmask.c index 49f47b0ce8..b87f7fcd7c 100644 --- a/nptl/pthread_sigmask.c +++ b/nptl/pthread_sigmask.c @@ -1,5 +1,5 @@ /* Examine and change blocked signals for a thread. Generic POSIX version. - Copyright (C) 2014-2015 Free Software Foundation, Inc. + Copyright (C) 2014-2016 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 diff --git a/nptl/pthread_sigqueue.c b/nptl/pthread_sigqueue.c index d518fc3609..06efd33007 100644 --- a/nptl/pthread_sigqueue.c +++ b/nptl/pthread_sigqueue.c @@ -1,5 +1,5 @@ /* Queue a signal (with value) for a specific pthread. Stub version. - Copyright (C) 2014-2015 Free Software Foundation, Inc. + Copyright (C) 2014-2016 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 diff --git a/nptl/pthread_spin_destroy.c b/nptl/pthread_spin_destroy.c index 0d41f443b0..ec294520b0 100644 --- a/nptl/pthread_spin_destroy.c +++ b/nptl/pthread_spin_destroy.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -20,8 +20,7 @@ int -pthread_spin_destroy (lock) - pthread_spinlock_t *lock; +pthread_spin_destroy (pthread_spinlock_t *lock) { /* Nothing to do. */ return 0; diff --git a/nptl/pthread_spin_init.c b/nptl/pthread_spin_init.c index 765a2748cc..8ed47721a5 100644 --- a/nptl/pthread_spin_init.c +++ b/nptl/pthread_spin_init.c @@ -1,5 +1,5 @@ /* pthread_spin_init -- initialize a spin lock. Generic version. - Copyright (C) 2003-2015 Free Software Foundation, Inc. + Copyright (C) 2003-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Paul Mackerras <paulus@au.ibm.com>, 2003. diff --git a/nptl/pthread_spin_lock.c b/nptl/pthread_spin_lock.c index 1d122bf914..fb9bcc104e 100644 --- a/nptl/pthread_spin_lock.c +++ b/nptl/pthread_spin_lock.c @@ -1,5 +1,5 @@ /* pthread_spin_lock -- lock a spin lock. Generic version. - Copyright (C) 2012-2015 Free Software Foundation, Inc. + Copyright (C) 2012-2016 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 diff --git a/nptl/pthread_spin_trylock.c b/nptl/pthread_spin_trylock.c index b7451e3742..4e1a96c03b 100644 --- a/nptl/pthread_spin_trylock.c +++ b/nptl/pthread_spin_trylock.c @@ -1,5 +1,5 @@ /* pthread_spin_trylock -- trylock a spin lock. Generic version. - Copyright (C) 2012-2015 Free Software Foundation, Inc. + Copyright (C) 2012-2016 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 diff --git a/nptl/pthread_spin_unlock.c b/nptl/pthread_spin_unlock.c index 35142b41e9..d4b63ac24f 100644 --- a/nptl/pthread_spin_unlock.c +++ b/nptl/pthread_spin_unlock.c @@ -1,5 +1,5 @@ /* pthread_spin_unlock -- unlock a spin lock. Generic version. - Copyright (C) 2003-2015 Free Software Foundation, Inc. + Copyright (C) 2003-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Paul Mackerras <paulus@au.ibm.com>, 2003. diff --git a/nptl/pthread_testcancel.c b/nptl/pthread_testcancel.c index c4eb18252e..51be09fc5b 100644 --- a/nptl/pthread_testcancel.c +++ b/nptl/pthread_testcancel.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. diff --git a/nptl/pthread_timedjoin.c b/nptl/pthread_timedjoin.c index 10567e61ff..71a89ea6d6 100644 --- a/nptl/pthread_timedjoin.c +++ b/nptl/pthread_timedjoin.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. diff --git a/nptl/pthread_tryjoin.c b/nptl/pthread_tryjoin.c index 33058443c8..d92e8edc8f 100644 --- a/nptl/pthread_tryjoin.c +++ b/nptl/pthread_tryjoin.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -24,9 +24,7 @@ int -pthread_tryjoin_np (threadid, thread_return) - pthread_t threadid; - void **thread_return; +pthread_tryjoin_np (pthread_t threadid, void **thread_return) { struct pthread *self; struct pthread *pd = (struct pthread *) threadid; diff --git a/nptl/pthread_yield.c b/nptl/pthread_yield.c index 0ec81e60e8..089a62f186 100644 --- a/nptl/pthread_yield.c +++ b/nptl/pthread_yield.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. diff --git a/nptl/register-atfork.c b/nptl/register-atfork.c index 681bb574c8..8e2d17e5fd 100644 --- a/nptl/register-atfork.c +++ b/nptl/register-atfork.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -80,11 +80,8 @@ fork_handler_alloc (void) int -__register_atfork (prepare, parent, child, dso_handle) - void (*prepare) (void); - void (*parent) (void); - void (*child) (void); - void *dso_handle; +__register_atfork (void (*prepare) (void), void (*parent) (void), + void (*child) (void), void *dso_handle) { /* Get the lock to not conflict with other allocations. */ lll_lock (__fork_lock, LLL_PRIVATE); diff --git a/nptl/res.c b/nptl/res.c index 70fcbe6460..5d308e594e 100644 --- a/nptl/res.c +++ b/nptl/res.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 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 diff --git a/nptl/sem_close.c b/nptl/sem_close.c index 7f1df14fc3..d7fbe17f4b 100644 --- a/nptl/sem_close.c +++ b/nptl/sem_close.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -40,8 +40,7 @@ walker (const void *inodep, const VISIT which, const int depth) int -sem_close (sem) - sem_t *sem; +sem_close (sem_t *sem) { int result = 0; diff --git a/nptl/sem_destroy.c b/nptl/sem_destroy.c index c74bbd0c90..5cb3295963 100644 --- a/nptl/sem_destroy.c +++ b/nptl/sem_destroy.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -22,8 +22,7 @@ int -__new_sem_destroy (sem) - sem_t *sem; +__new_sem_destroy (sem_t *sem) { /* XXX Check for valid parameter. */ diff --git a/nptl/sem_getvalue.c b/nptl/sem_getvalue.c index 1432cc795e..f2d903f350 100644 --- a/nptl/sem_getvalue.c +++ b/nptl/sem_getvalue.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. diff --git a/nptl/sem_init.c b/nptl/sem_init.c index bd1b592420..be0f27dbdf 100644 --- a/nptl/sem_init.c +++ b/nptl/sem_init.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -64,10 +64,7 @@ versioned_symbol (libpthread, __new_sem_init, sem_init, GLIBC_2_1); #if SHLIB_COMPAT(libpthread, GLIBC_2_0, GLIBC_2_1) int attribute_compat_text_section -__old_sem_init (sem, pshared, value) - sem_t *sem; - int pshared; - unsigned int value; +__old_sem_init (sem_t *sem, int pshared, unsigned int value) { /* Parameter sanity check. */ if (__glibc_unlikely (value > SEM_VALUE_MAX)) diff --git a/nptl/sem_open.c b/nptl/sem_open.c index 5ee8b71aa5..911b1f30a9 100644 --- a/nptl/sem_open.c +++ b/nptl/sem_open.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. diff --git a/nptl/sem_post.c b/nptl/sem_post.c index 06d835907e..6cc930c332 100644 --- a/nptl/sem_post.c +++ b/nptl/sem_post.c @@ -1,5 +1,5 @@ /* sem_post -- post to a POSIX semaphore. Generic futex-using version. - Copyright (C) 2003-2015 Free Software Foundation, Inc. + Copyright (C) 2003-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Jakub Jelinek <jakub@redhat.com>, 2003. diff --git a/nptl/sem_timedwait.c b/nptl/sem_timedwait.c index 042b0acd58..1aab25a7cf 100644 --- a/nptl/sem_timedwait.c +++ b/nptl/sem_timedwait.c @@ -1,5 +1,5 @@ /* sem_timedwait -- wait on a semaphore with timeout. - Copyright (C) 2003-2015 Free Software Foundation, Inc. + Copyright (C) 2003-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Paul Mackerras <paulus@au.ibm.com>, 2003. diff --git a/nptl/sem_unlink.c b/nptl/sem_unlink.c index 8f0bc56446..b50d4a4cf6 100644 --- a/nptl/sem_unlink.c +++ b/nptl/sem_unlink.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. diff --git a/nptl/sem_wait.c b/nptl/sem_wait.c index fce7ed43ee..84b523a768 100644 --- a/nptl/sem_wait.c +++ b/nptl/sem_wait.c @@ -1,5 +1,5 @@ /* sem_wait -- wait on a semaphore. Generic futex-using version. - Copyright (C) 2003-2015 Free Software Foundation, Inc. + Copyright (C) 2003-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Paul Mackerras <paulus@au.ibm.com>, 2003. diff --git a/nptl/sem_waitcommon.c b/nptl/sem_waitcommon.c index f222e71895..3ba73ab0b7 100644 --- a/nptl/sem_waitcommon.c +++ b/nptl/sem_waitcommon.c @@ -1,5 +1,5 @@ /* sem_waitcommon -- wait on a semaphore, shared code. - Copyright (C) 2003-2015 Free Software Foundation, Inc. + Copyright (C) 2003-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Paul Mackerras <paulus@au.ibm.com>, 2003. diff --git a/nptl/semaphoreP.h b/nptl/semaphoreP.h index b9d6bd995f..493bb6eb2a 100644 --- a/nptl/semaphoreP.h +++ b/nptl/semaphoreP.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. diff --git a/nptl/sigaction.c b/nptl/sigaction.c index 2858da563a..8bd832509b 100644 --- a/nptl/sigaction.c +++ b/nptl/sigaction.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -29,10 +29,7 @@ int -__sigaction (sig, act, oact) - int sig; - const struct sigaction *act; - struct sigaction *oact; +__sigaction (int sig, const struct sigaction *act, struct sigaction *oact) { if (__glibc_unlikely (sig == SIGCANCEL || sig == SIGSETXID)) { diff --git a/nptl/smp.h b/nptl/smp.h index 41090440eb..bedfb467ee 100644 --- a/nptl/smp.h +++ b/nptl/smp.h @@ -1,5 +1,5 @@ /* Determine whether the host has multiple processors. Stub version. - Copyright (C) 1996-2015 Free Software Foundation, Inc. + Copyright (C) 1996-2016 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 diff --git a/nptl/stack-aliasing.h b/nptl/stack-aliasing.h index c92538992b..10ff366ca2 100644 --- a/nptl/stack-aliasing.h +++ b/nptl/stack-aliasing.h @@ -1,5 +1,5 @@ /* Define macros for stack address aliasing issues for NPTL. Stub version. - Copyright (C) 2014-2015 Free Software Foundation, Inc. + Copyright (C) 2014-2016 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 diff --git a/nptl/tpp.c b/nptl/tpp.c index 142c618b13..e175bf4d53 100644 --- a/nptl/tpp.c +++ b/nptl/tpp.c @@ -1,5 +1,5 @@ /* Thread Priority Protect helpers. - Copyright (C) 2006-2015 Free Software Foundation, Inc. + Copyright (C) 2006-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Jakub Jelinek <jakub@redhat.com>, 2006. diff --git a/nptl/tst-_res1.c b/nptl/tst-_res1.c index 5ff417bbb9..4facfd1271 100644 --- a/nptl/tst-_res1.c +++ b/nptl/tst-_res1.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003-2015 Free Software Foundation, Inc. +/* Copyright (C) 2003-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Jakub Jelinek <jakub@redhat.com>, 2003. diff --git a/nptl/tst-_res1mod1.c b/nptl/tst-_res1mod1.c index 52be3e32be..cbe230fa02 100644 --- a/nptl/tst-_res1mod1.c +++ b/nptl/tst-_res1mod1.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003-2015 Free Software Foundation, Inc. +/* Copyright (C) 2003-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Jakub Jelinek <jakub@redhat.com>, 2003. diff --git a/nptl/tst-abstime.c b/nptl/tst-abstime.c index 1973a57ff7..c59e812368 100644 --- a/nptl/tst-abstime.c +++ b/nptl/tst-abstime.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2010-2015 Free Software Foundation, Inc. +/* Copyright (C) 2010-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Andreas Schwab <schwab@redhat.com>, 2010. diff --git a/nptl/tst-align.c b/nptl/tst-align.c index 9be0ed29fa..b81be9d689 100644 --- a/nptl/tst-align.c +++ b/nptl/tst-align.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003-2015 Free Software Foundation, Inc. +/* Copyright (C) 2003-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2003. diff --git a/nptl/tst-align3.c b/nptl/tst-align3.c index e97b85f6cb..d500963a36 100644 --- a/nptl/tst-align3.c +++ b/nptl/tst-align3.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2005-2015 Free Software Foundation, Inc. +/* Copyright (C) 2005-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Jakub Jelinek <jakub@redhat.com>, 2005. diff --git a/nptl/tst-atfork1.c b/nptl/tst-atfork1.c index 4b956e253a..3f57bc2fc1 100644 --- a/nptl/tst-atfork1.c +++ b/nptl/tst-atfork1.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. diff --git a/nptl/tst-atfork2.c b/nptl/tst-atfork2.c index 25af212a16..d2285f2dbf 100644 --- a/nptl/tst-atfork2.c +++ b/nptl/tst-atfork2.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003-2015 Free Software Foundation, Inc. +/* Copyright (C) 2003-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2003. diff --git a/nptl/tst-atfork2mod.c b/nptl/tst-atfork2mod.c index a9872c2a7f..7c592b4718 100644 --- a/nptl/tst-atfork2mod.c +++ b/nptl/tst-atfork2mod.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003-2015 Free Software Foundation, Inc. +/* Copyright (C) 2003-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2003. diff --git a/nptl/tst-attr1.c b/nptl/tst-attr1.c index e074f3a6e7..16cc53dfc7 100644 --- a/nptl/tst-attr1.c +++ b/nptl/tst-attr1.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003-2015 Free Software Foundation, Inc. +/* Copyright (C) 2003-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2003. diff --git a/nptl/tst-attr2.c b/nptl/tst-attr2.c index c09db5470b..b1730b8cd8 100644 --- a/nptl/tst-attr2.c +++ b/nptl/tst-attr2.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003-2015 Free Software Foundation, Inc. +/* Copyright (C) 2003-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2003. diff --git a/nptl/tst-attr3.c b/nptl/tst-attr3.c index 4d5fab8e85..a6a5665637 100644 --- a/nptl/tst-attr3.c +++ b/nptl/tst-attr3.c @@ -1,5 +1,5 @@ /* pthread_getattr_np test. - Copyright (C) 2003-2015 Free Software Foundation, Inc. + Copyright (C) 2003-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Jakub Jelinek <jakub@redhat.com>, 2003. diff --git a/nptl/tst-backtrace1.c b/nptl/tst-backtrace1.c index 815053767a..30b39e04e5 100644 --- a/nptl/tst-backtrace1.c +++ b/nptl/tst-backtrace1.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2004-2015 Free Software Foundation, Inc. +/* Copyright (C) 2004-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Jakub Jelinek <jakub@redhat.com>, 2004. diff --git a/nptl/tst-bad-schedattr.c b/nptl/tst-bad-schedattr.c index c2482b10cf..422697d8d3 100644 --- a/nptl/tst-bad-schedattr.c +++ b/nptl/tst-bad-schedattr.c @@ -1,5 +1,5 @@ /* Test that pthread_create diagnoses invalid scheduling parameters. - Copyright (C) 2014-2015 Free Software Foundation, Inc. + Copyright (C) 2014-2016 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 diff --git a/nptl/tst-barrier1.c b/nptl/tst-barrier1.c index 4eb081a54a..d5016c49a3 100644 --- a/nptl/tst-barrier1.c +++ b/nptl/tst-barrier1.c @@ -1,4 +1,5 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Tests barrier initialization. + Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. diff --git a/nptl/tst-barrier2.c b/nptl/tst-barrier2.c index f78bfaf4ec..cc82fbfca6 100644 --- a/nptl/tst-barrier2.c +++ b/nptl/tst-barrier2.c @@ -1,4 +1,5 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Tests process-shared barriers. + Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. diff --git a/nptl/tst-barrier3.c b/nptl/tst-barrier3.c index 4fb8b6a576..7abfa510cf 100644 --- a/nptl/tst-barrier3.c +++ b/nptl/tst-barrier3.c @@ -1,4 +1,5 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Test of POSIX barriers. + Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -16,8 +17,6 @@ License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ -/* Test of POSIX barriers. */ - #include <pthread.h> #include <stdio.h> #include <stdlib.h> diff --git a/nptl/tst-barrier4.c b/nptl/tst-barrier4.c index 991ee55d5c..81dbf84824 100644 --- a/nptl/tst-barrier4.c +++ b/nptl/tst-barrier4.c @@ -1,4 +1,5 @@ -/* Copyright (C) 2004-2015 Free Software Foundation, Inc. +/* This tests destruction of a barrier right after waiting on it. + Copyright (C) 2004-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2004. @@ -16,7 +17,6 @@ License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ -/* This is a test for behavior not guaranteed by POSIX. */ #include <errno.h> #include <pthread.h> #include <stdio.h> diff --git a/nptl/tst-barrier5.c b/nptl/tst-barrier5.c new file mode 100644 index 0000000000..d665681356 --- /dev/null +++ b/nptl/tst-barrier5.c @@ -0,0 +1,145 @@ +/* This tests the barrier reset mechanism. + Copyright (C) 2004-2015 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 + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#include <errno.h> +#include <pthread.h> +#include <stdio.h> +#include <stdlib.h> +#include <internaltypes.h> + + +static pthread_barrier_t b1; +static pthread_barrier_t b2; + + +#define N 20 +#define ROUNDS_PER_RUN 20 +#define START ((BARRIER_IN_THRESHOLD / N - ROUNDS_PER_RUN / 2) * N) + +static void * +tf (void *arg) +{ + int runs = 0; + + while (runs++ < 30) + { + /* In each run, we execute a number of rounds and initialize the barrier + so that we will go over the reset threshold with those rounds. */ + for (int rounds = 0; rounds < ROUNDS_PER_RUN; rounds++) + pthread_barrier_wait (&b1); + + if (pthread_barrier_wait (&b1) == PTHREAD_BARRIER_SERIAL_THREAD) + { + pthread_barrier_destroy (&b1); + if (pthread_barrier_init (&b1, NULL, N) != 0) + { + puts ("tf: 1st barrier_init failed"); + exit (1); + } + puts ("b1 reinitialized"); + /* Trigger a reset. */ + struct pthread_barrier *bar = (struct pthread_barrier *) &b1; + bar->in = START; + bar->out = START; + /* We deliberately don't set bar->current_round so that we also + test whether the helping for the updates of current_round + works correctly. */ + } + + /* Same as above, just for b2. */ + for (int rounds = 0; rounds < ROUNDS_PER_RUN; rounds++) + pthread_barrier_wait (&b2); + + if (pthread_barrier_wait (&b2) == PTHREAD_BARRIER_SERIAL_THREAD) + { + pthread_barrier_destroy (&b2); + if (pthread_barrier_init (&b2, NULL, N) != 0) + { + puts ("tf: 2nd barrier_init failed"); + exit (1); + } + puts ("b2 reinitialized"); + /* Trigger a reset. See above. */ + struct pthread_barrier *bar = (struct pthread_barrier *) &b2; + bar->in = START; + bar->out = START; + } + } + + return NULL; +} + + +static int +do_test (void) +{ + pthread_attr_t at; + int cnt; + + if (pthread_attr_init (&at) != 0) + { + puts ("attr_init failed"); + return 1; + } + + if (pthread_attr_setstacksize (&at, 1 * 1024 * 1024) != 0) + { + puts ("attr_setstacksize failed"); + return 1; + } + + if (pthread_barrier_init (&b1, NULL, N) != 0) + { + puts ("1st barrier_init failed"); + return 1; + } + + if (pthread_barrier_init (&b2, NULL, N) != 0) + { + puts ("2nd barrier_init failed"); + return 1; + } + + pthread_t th[N - 1]; + for (cnt = 0; cnt < N - 1; ++cnt) + if (pthread_create (&th[cnt], &at, tf, NULL) != 0) + { + puts ("pthread_create failed"); + return 1; + } + + if (pthread_attr_destroy (&at) != 0) + { + puts ("attr_destroy failed"); + return 1; + } + + tf (NULL); + + for (cnt = 0; cnt < N - 1; ++cnt) + if (pthread_join (th[cnt], NULL) != 0) + { + puts ("pthread_join failed"); + return 1; + } + + return 0; +} + +#define TEST_FUNCTION do_test () +#include "../test-skeleton.c" diff --git a/nptl/tst-basic1.c b/nptl/tst-basic1.c index ad7a1f292c..8ea4523074 100644 --- a/nptl/tst-basic1.c +++ b/nptl/tst-basic1.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. diff --git a/nptl/tst-basic2.c b/nptl/tst-basic2.c index 7b9b2df28d..086d5a40e0 100644 --- a/nptl/tst-basic2.c +++ b/nptl/tst-basic2.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. diff --git a/nptl/tst-basic3.c b/nptl/tst-basic3.c index c6a4bd38cf..d363729f66 100644 --- a/nptl/tst-basic3.c +++ b/nptl/tst-basic3.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003-2015 Free Software Foundation, Inc. +/* Copyright (C) 2003-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2003. diff --git a/nptl/tst-basic4.c b/nptl/tst-basic4.c index 33be8f8b57..7f47550f4b 100644 --- a/nptl/tst-basic4.c +++ b/nptl/tst-basic4.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003-2015 Free Software Foundation, Inc. +/* Copyright (C) 2003-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2003. diff --git a/nptl/tst-basic5.c b/nptl/tst-basic5.c index 38b6bd3801..192cf5c456 100644 --- a/nptl/tst-basic5.c +++ b/nptl/tst-basic5.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003-2015 Free Software Foundation, Inc. +/* Copyright (C) 2003-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2003. diff --git a/nptl/tst-basic6.c b/nptl/tst-basic6.c index b074fad86a..cdefbb0251 100644 --- a/nptl/tst-basic6.c +++ b/nptl/tst-basic6.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003-2015 Free Software Foundation, Inc. +/* Copyright (C) 2003-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2003. diff --git a/nptl/tst-cancel-self-cancelstate.c b/nptl/tst-cancel-self-cancelstate.c index 1be118d2b5..6c0c5f9301 100644 --- a/nptl/tst-cancel-self-cancelstate.c +++ b/nptl/tst-cancel-self-cancelstate.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2012-2015 Free Software Foundation, Inc. +/* Copyright (C) 2012-2016 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 diff --git a/nptl/tst-cancel-self-canceltype.c b/nptl/tst-cancel-self-canceltype.c index 1f67dc3ae6..be22a7fe84 100644 --- a/nptl/tst-cancel-self-canceltype.c +++ b/nptl/tst-cancel-self-canceltype.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2012-2015 Free Software Foundation, Inc. +/* Copyright (C) 2012-2016 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 diff --git a/nptl/tst-cancel-self-cleanup.c b/nptl/tst-cancel-self-cleanup.c index 11c58514ac..a2845703ba 100644 --- a/nptl/tst-cancel-self-cleanup.c +++ b/nptl/tst-cancel-self-cleanup.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2012-2015 Free Software Foundation, Inc. +/* Copyright (C) 2012-2016 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 diff --git a/nptl/tst-cancel-self-testcancel.c b/nptl/tst-cancel-self-testcancel.c index 9105fa4f73..96ff959b72 100644 --- a/nptl/tst-cancel-self-testcancel.c +++ b/nptl/tst-cancel-self-testcancel.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2012-2015 Free Software Foundation, Inc. +/* Copyright (C) 2012-2016 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 diff --git a/nptl/tst-cancel-self.c b/nptl/tst-cancel-self.c index 737e12963e..c684148f09 100644 --- a/nptl/tst-cancel-self.c +++ b/nptl/tst-cancel-self.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2012-2015 Free Software Foundation, Inc. +/* Copyright (C) 2012-2016 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 diff --git a/nptl/tst-cancel-wrappers.sh b/nptl/tst-cancel-wrappers.sh index b2d8302654..9098e3238f 100644 --- a/nptl/tst-cancel-wrappers.sh +++ b/nptl/tst-cancel-wrappers.sh @@ -1,6 +1,6 @@ -#! /bin/sh +#!/bin/sh # Test whether all cancelable functions are cancelable. -# Copyright (C) 2002-2015 Free Software Foundation, Inc. +# Copyright (C) 2002-2016 Free Software Foundation, Inc. # This file is part of the GNU C Library. # Contributed by Jakub Jelinek <jakub@redhat.com>, 2002. @@ -74,7 +74,7 @@ C["__xpg_sigpause"]=1 seen="" seen_enable="" seen_disable="" - object=gensub(/^.*\[(.*)\]:$/,"\\1","",$0) + object=gensub(/^.*\[(.*)\]:$/, "\\1", 1, $0) next } { diff --git a/nptl/tst-cancel1.c b/nptl/tst-cancel1.c index c5c4f2bbf9..af03c70273 100644 --- a/nptl/tst-cancel1.c +++ b/nptl/tst-cancel1.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. diff --git a/nptl/tst-cancel10.c b/nptl/tst-cancel10.c index 0b00534b2f..e6e955d9c5 100644 --- a/nptl/tst-cancel10.c +++ b/nptl/tst-cancel10.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003-2015 Free Software Foundation, Inc. +/* Copyright (C) 2003-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2003. diff --git a/nptl/tst-cancel11.c b/nptl/tst-cancel11.c index 6c4c5745d6..7a0e7eef0f 100644 --- a/nptl/tst-cancel11.c +++ b/nptl/tst-cancel11.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003-2015 Free Software Foundation, Inc. +/* Copyright (C) 2003-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2003. diff --git a/nptl/tst-cancel12.c b/nptl/tst-cancel12.c index 215c9b8a9d..ac8f5a0559 100644 --- a/nptl/tst-cancel12.c +++ b/nptl/tst-cancel12.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003-2015 Free Software Foundation, Inc. +/* Copyright (C) 2003-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2003. diff --git a/nptl/tst-cancel13.c b/nptl/tst-cancel13.c index cd1974787c..c84780ded3 100644 --- a/nptl/tst-cancel13.c +++ b/nptl/tst-cancel13.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003-2015 Free Software Foundation, Inc. +/* Copyright (C) 2003-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2003. diff --git a/nptl/tst-cancel14.c b/nptl/tst-cancel14.c index be756cf614..3810d2b289 100644 --- a/nptl/tst-cancel14.c +++ b/nptl/tst-cancel14.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003-2015 Free Software Foundation, Inc. +/* Copyright (C) 2003-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2003. diff --git a/nptl/tst-cancel15.c b/nptl/tst-cancel15.c index 859b29bf5c..f413839ec2 100644 --- a/nptl/tst-cancel15.c +++ b/nptl/tst-cancel15.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003-2015 Free Software Foundation, Inc. +/* Copyright (C) 2003-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2003. diff --git a/nptl/tst-cancel16.c b/nptl/tst-cancel16.c index d788427dc0..49e5c3ae1d 100644 --- a/nptl/tst-cancel16.c +++ b/nptl/tst-cancel16.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003-2015 Free Software Foundation, Inc. +/* Copyright (C) 2003-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2003. diff --git a/nptl/tst-cancel17.c b/nptl/tst-cancel17.c index 04d05d1b7b..fb89292070 100644 --- a/nptl/tst-cancel17.c +++ b/nptl/tst-cancel17.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003-2015 Free Software Foundation, Inc. +/* Copyright (C) 2003-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2003. diff --git a/nptl/tst-cancel18.c b/nptl/tst-cancel18.c index b2e95f03d9..06f4438bbe 100644 --- a/nptl/tst-cancel18.c +++ b/nptl/tst-cancel18.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003-2015 Free Software Foundation, Inc. +/* Copyright (C) 2003-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2003. diff --git a/nptl/tst-cancel19.c b/nptl/tst-cancel19.c index 591321b39b..1747877965 100644 --- a/nptl/tst-cancel19.c +++ b/nptl/tst-cancel19.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003-2015 Free Software Foundation, Inc. +/* Copyright (C) 2003-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Jakub Jelinek <jakub@redhat.com>, 2003. diff --git a/nptl/tst-cancel2.c b/nptl/tst-cancel2.c index 1a74992aeb..ddef5ba17a 100644 --- a/nptl/tst-cancel2.c +++ b/nptl/tst-cancel2.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. diff --git a/nptl/tst-cancel20.c b/nptl/tst-cancel20.c index 51b558e98d..b735fe8ea1 100644 --- a/nptl/tst-cancel20.c +++ b/nptl/tst-cancel20.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003-2015 Free Software Foundation, Inc. +/* Copyright (C) 2003-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Jakub Jelinek <jakub@redhat.com>, 2003. @@ -145,12 +145,6 @@ do_one_test (void) return 1; } - /* This will cause the read in the child to return. */ - close (fd[0]); - close (fd[1]); - close (fd[2]); - close (fd[3]); - void *ret; if (pthread_join (th, &ret) != 0) { @@ -170,6 +164,15 @@ do_one_test (void) return 1; } + /* The pipe closing must be issued after the cancellation handling to avoid + a race condition where the cancellation runs after both pipe ends are + closed. In this case the read syscall returns EOF and the cancellation + must not act. */ + close (fd[0]); + close (fd[1]); + close (fd[2]); + close (fd[3]); + return 0; } diff --git a/nptl/tst-cancel21.c b/nptl/tst-cancel21.c index b54f236b03..c23faa927f 100644 --- a/nptl/tst-cancel21.c +++ b/nptl/tst-cancel21.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003-2015 Free Software Foundation, Inc. +/* Copyright (C) 2003-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Jakub Jelinek <jakub@redhat.com>, 2003. @@ -123,12 +123,6 @@ tf (void *arg) exit (1); } - /* This will cause the read in the initial thread to return. */ - close (fd[0]); - close (fd[1]); - close (fd[2]); - close (fd[3]); - void *ret; if (pthread_join (th, &ret) != 0) { @@ -154,6 +148,15 @@ tf (void *arg) exit (1); } + /* The pipe closing must be issued after the cancellation handling to avoid + a race condition where the cancellation runs after both pipe ends are + closed. In this case the read syscall returns EOF and the cancellation + must not act. */ + close (fd[0]); + close (fd[1]); + close (fd[2]); + close (fd[3]); + exit (0); } diff --git a/nptl/tst-cancel22.c b/nptl/tst-cancel22.c index 803ad72eaf..902d119aca 100644 --- a/nptl/tst-cancel22.c +++ b/nptl/tst-cancel22.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003-2015 Free Software Foundation, Inc. +/* Copyright (C) 2003-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Jakub Jelinek <jakub@redhat.com>, 2003. diff --git a/nptl/tst-cancel26.c b/nptl/tst-cancel26.c new file mode 100644 index 0000000000..53efeb4e0f --- /dev/null +++ b/nptl/tst-cancel26.c @@ -0,0 +1,68 @@ +/* Check for failure paths handling for cancellation points. + Copyright (C) 2015-2016 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 + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#include <errno.h> +#include <pthread.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <unistd.h> + +/* Check that the cancel syscall points handles both the errno and return code + correctly for invalid arguments. */ +static void * +tf (void *arg) +{ +#ifdef SET_CANCEL_DISABLE + pthread_setcancelstate (PTHREAD_CANCEL_DISABLE, NULL); +#endif + + /* This is a cancellation point, but we should not be cancelled. */ + int r = write (-1, 0, 0); + + if (r != -1 || errno != EBADF) + { + printf ("error: write returned %d, errno %d\n", r, errno); + exit (1); + } + + return NULL; +} + +static int +do_test (void) +{ + pthread_t th; + + if (pthread_create (&th, NULL, tf, NULL) != 0) + { + puts ("error: pthread_create failed"); + exit (1); + } + + if (pthread_join (th, NULL) != 0) + { + puts ("error: pthread_join failed"); + exit (1); + } + + return 0; +} + +#define TEST_FUNCTION do_test () +#include "../test-skeleton.c" diff --git a/nptl/check-cpuset.h b/nptl/tst-cancel27.c index 315bdf2626..03107a68a5 100644 --- a/nptl/check-cpuset.h +++ b/nptl/tst-cancel27.c @@ -1,5 +1,5 @@ -/* Validate cpu_set_t values for NPTL. Stub version. - Copyright (C) 2015 Free Software Foundation, Inc. +/* Check for failure paths handling for cancellation points. + Copyright (C) 2015-2016 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 @@ -16,17 +16,8 @@ License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ -#include <errno.h> +/* Similar to tst-cancel26.c but with pthread cancel state set to + PTHREAD_CANCEL_DISABLE. */ -/* Returns 0 if CS and SZ are valid values for the cpuset and cpuset size - respectively. Otherwise it returns an error number. */ -static inline int -check_cpuset_attr (const cpu_set_t *cs, const size_t sz) -{ - if (sz == 0) - return 0; - - /* This means pthread_attr_setaffinity will return ENOSYS, which - is the right thing when the cpu_set_t features are not available. */ - return ENOSYS; -} +#define SET_CANCEL_DISABLE 1 +#include "tst-cancel26.c" diff --git a/nptl/tst-cancel3.c b/nptl/tst-cancel3.c index 305e7ecd6f..8f0a92407e 100644 --- a/nptl/tst-cancel3.c +++ b/nptl/tst-cancel3.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. diff --git a/nptl/tst-cancel4.c b/nptl/tst-cancel4.c index e50afd7900..1478174028 100644 --- a/nptl/tst-cancel4.c +++ b/nptl/tst-cancel4.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. diff --git a/nptl/tst-cancel6.c b/nptl/tst-cancel6.c index 8c5d52b2ac..027cc28cd3 100644 --- a/nptl/tst-cancel6.c +++ b/nptl/tst-cancel6.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. diff --git a/nptl/tst-cancel7.c b/nptl/tst-cancel7.c index b6d9cd714c..7f20862952 100644 --- a/nptl/tst-cancel7.c +++ b/nptl/tst-cancel7.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Jakub Jelinek <jakub@redhat.com>, 2002. diff --git a/nptl/tst-cancel8.c b/nptl/tst-cancel8.c index 02ea594534..8347440bd9 100644 --- a/nptl/tst-cancel8.c +++ b/nptl/tst-cancel8.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003-2015 Free Software Foundation, Inc. +/* Copyright (C) 2003-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2003. diff --git a/nptl/tst-cancel9.c b/nptl/tst-cancel9.c index f97db29e9f..ad87e1bf9b 100644 --- a/nptl/tst-cancel9.c +++ b/nptl/tst-cancel9.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003-2015 Free Software Foundation, Inc. +/* Copyright (C) 2003-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2003. diff --git a/nptl/tst-cleanup0.c b/nptl/tst-cleanup0.c index a7190a5b6f..011e5a60c1 100644 --- a/nptl/tst-cleanup0.c +++ b/nptl/tst-cleanup0.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. diff --git a/nptl/tst-cleanup1.c b/nptl/tst-cleanup1.c index 4bdaad7092..82a568b072 100644 --- a/nptl/tst-cleanup1.c +++ b/nptl/tst-cleanup1.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. diff --git a/nptl/tst-cleanup2.c b/nptl/tst-cleanup2.c index 9e5a9570a4..fbcb484892 100644 --- a/nptl/tst-cleanup2.c +++ b/nptl/tst-cleanup2.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003-2015 Free Software Foundation, Inc. +/* Copyright (C) 2003-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Bao Duong <bduong@progress.com>, 2003. diff --git a/nptl/tst-cleanup3.c b/nptl/tst-cleanup3.c index e85f1fdc76..3c34a1e0de 100644 --- a/nptl/tst-cleanup3.c +++ b/nptl/tst-cleanup3.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003-2015 Free Software Foundation, Inc. +/* Copyright (C) 2003-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2003. diff --git a/nptl/tst-cleanup4.c b/nptl/tst-cleanup4.c index ea587584fd..b7c6c23fd9 100644 --- a/nptl/tst-cleanup4.c +++ b/nptl/tst-cleanup4.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003-2015 Free Software Foundation, Inc. +/* Copyright (C) 2003-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Jakub Jelinek <jakub@redhat.com>, 2003. diff --git a/nptl/tst-cleanup4aux.c b/nptl/tst-cleanup4aux.c index 3f6bf37475..c1800a85d4 100644 --- a/nptl/tst-cleanup4aux.c +++ b/nptl/tst-cleanup4aux.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003-2015 Free Software Foundation, Inc. +/* Copyright (C) 2003-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Jakub Jelinek <jakub@redhat.com>, 2003. diff --git a/nptl/tst-clock1.c b/nptl/tst-clock1.c index 23d26dd86d..824991802a 100644 --- a/nptl/tst-clock1.c +++ b/nptl/tst-clock1.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003-2015 Free Software Foundation, Inc. +/* Copyright (C) 2003-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2003. diff --git a/nptl/tst-clock2.c b/nptl/tst-clock2.c index 58c4ee5acc..4ab1ae79bd 100644 --- a/nptl/tst-clock2.c +++ b/nptl/tst-clock2.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003-2015 Free Software Foundation, Inc. +/* Copyright (C) 2003-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2003. diff --git a/nptl/tst-cond-except.c b/nptl/tst-cond-except.c index 239403bd96..e519a09f0c 100644 --- a/nptl/tst-cond-except.c +++ b/nptl/tst-cond-except.c @@ -1,5 +1,5 @@ /* Verify that exception table for pthread_cond_wait is correct. - Copyright (C) 2012-2015 Free Software Foundation, Inc. + Copyright (C) 2012-2016 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 diff --git a/nptl/tst-cond1.c b/nptl/tst-cond1.c index 64f90e0aa4..75ab9c8d8a 100644 --- a/nptl/tst-cond1.c +++ b/nptl/tst-cond1.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. diff --git a/nptl/tst-cond10.c b/nptl/tst-cond10.c index 4e3a587693..b6238c8e70 100644 --- a/nptl/tst-cond10.c +++ b/nptl/tst-cond10.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003-2015 Free Software Foundation, Inc. +/* Copyright (C) 2003-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2003. diff --git a/nptl/tst-cond11.c b/nptl/tst-cond11.c index 669b75e9b1..e91b956c63 100644 --- a/nptl/tst-cond11.c +++ b/nptl/tst-cond11.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003-2015 Free Software Foundation, Inc. +/* Copyright (C) 2003-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2003. diff --git a/nptl/tst-cond12.c b/nptl/tst-cond12.c index aa1244e845..e012172a3b 100644 --- a/nptl/tst-cond12.c +++ b/nptl/tst-cond12.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003-2015 Free Software Foundation, Inc. +/* Copyright (C) 2003-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2003. diff --git a/nptl/tst-cond14.c b/nptl/tst-cond14.c index 1af43dd616..15168bbd8d 100644 --- a/nptl/tst-cond14.c +++ b/nptl/tst-cond14.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2004-2015 Free Software Foundation, Inc. +/* Copyright (C) 2004-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2004. diff --git a/nptl/tst-cond15.c b/nptl/tst-cond15.c index 2a67d4796e..d129f234ab 100644 --- a/nptl/tst-cond15.c +++ b/nptl/tst-cond15.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2004-2015 Free Software Foundation, Inc. +/* Copyright (C) 2004-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2004. diff --git a/nptl/tst-cond16.c b/nptl/tst-cond16.c index 9cf83d2159..b59e77dc26 100644 --- a/nptl/tst-cond16.c +++ b/nptl/tst-cond16.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2004-2015 Free Software Foundation, Inc. +/* Copyright (C) 2004-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Jakub Jelinek <jakub@redhat.com>, 2004. diff --git a/nptl/tst-cond18.c b/nptl/tst-cond18.c index ceeb1aa1ed..49fbc32179 100644 --- a/nptl/tst-cond18.c +++ b/nptl/tst-cond18.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2004-2015 Free Software Foundation, Inc. +/* Copyright (C) 2004-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Jakub Jelinek <jakub@redhat.com>, 2004. diff --git a/nptl/tst-cond19.c b/nptl/tst-cond19.c index c0350e06f1..5bd42b67ba 100644 --- a/nptl/tst-cond19.c +++ b/nptl/tst-cond19.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2004-2015 Free Software Foundation, Inc. +/* Copyright (C) 2004-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2004. diff --git a/nptl/tst-cond2.c b/nptl/tst-cond2.c index b7227b51df..b744d74e93 100644 --- a/nptl/tst-cond2.c +++ b/nptl/tst-cond2.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. diff --git a/nptl/tst-cond20.c b/nptl/tst-cond20.c index 9de062ac6f..918c4adb51 100644 --- a/nptl/tst-cond20.c +++ b/nptl/tst-cond20.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2004-2015 Free Software Foundation, Inc. +/* Copyright (C) 2004-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Jakub Jelinek <jakub@redhat.com>, 2004. diff --git a/nptl/tst-cond23.c b/nptl/tst-cond23.c index 3be8020ff2..4ad4d79894 100644 --- a/nptl/tst-cond23.c +++ b/nptl/tst-cond23.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2008-2015 Free Software Foundation, Inc. +/* Copyright (C) 2008-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Jakub Jelinek <jakub@redhat.com>, 2008. diff --git a/nptl/tst-cond24.c b/nptl/tst-cond24.c index d1c2ec7976..3d4201dfed 100644 --- a/nptl/tst-cond24.c +++ b/nptl/tst-cond24.c @@ -1,5 +1,5 @@ /* Verify that condition variables synchronized by PI mutexes don't hang. - Copyright (C) 2012-2015 Free Software Foundation, Inc. + Copyright (C) 2012-2016 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 diff --git a/nptl/tst-cond25.c b/nptl/tst-cond25.c index be0bec484d..d7f7bee0e6 100644 --- a/nptl/tst-cond25.c +++ b/nptl/tst-cond25.c @@ -1,6 +1,6 @@ /* Verify that condition variables synchronized by PI mutexes don't hang on on cancellation. - Copyright (C) 2012-2015 Free Software Foundation, Inc. + Copyright (C) 2012-2016 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 diff --git a/nptl/tst-cond3.c b/nptl/tst-cond3.c index 6c2089692f..ff904e4378 100644 --- a/nptl/tst-cond3.c +++ b/nptl/tst-cond3.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. diff --git a/nptl/tst-cond4.c b/nptl/tst-cond4.c index 57a1e53965..3397a0014b 100644 --- a/nptl/tst-cond4.c +++ b/nptl/tst-cond4.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. diff --git a/nptl/tst-cond5.c b/nptl/tst-cond5.c index 87c8d69512..4e4d1857a2 100644 --- a/nptl/tst-cond5.c +++ b/nptl/tst-cond5.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. diff --git a/nptl/tst-cond6.c b/nptl/tst-cond6.c index f1f0386eaf..7951499b9f 100644 --- a/nptl/tst-cond6.c +++ b/nptl/tst-cond6.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. diff --git a/nptl/tst-cond7.c b/nptl/tst-cond7.c index eff9a60271..ba345a44dc 100644 --- a/nptl/tst-cond7.c +++ b/nptl/tst-cond7.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003-2015 Free Software Foundation, Inc. +/* Copyright (C) 2003-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Jakub Jelinek <jakub@redhat.com>, 2003. diff --git a/nptl/tst-cond8.c b/nptl/tst-cond8.c index 9f8f03d421..a4e5283e81 100644 --- a/nptl/tst-cond8.c +++ b/nptl/tst-cond8.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003-2015 Free Software Foundation, Inc. +/* Copyright (C) 2003-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2003. diff --git a/nptl/tst-cond9.c b/nptl/tst-cond9.c index 43101f4a1d..214aa8f8b0 100644 --- a/nptl/tst-cond9.c +++ b/nptl/tst-cond9.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003-2015 Free Software Foundation, Inc. +/* Copyright (C) 2003-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2003. diff --git a/nptl/tst-context1.c b/nptl/tst-context1.c index 669a8f93c7..7c04d819d7 100644 --- a/nptl/tst-context1.c +++ b/nptl/tst-context1.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003-2015 Free Software Foundation, Inc. +/* Copyright (C) 2003-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2003. diff --git a/nptl/tst-default-attr.c b/nptl/tst-default-attr.c index afcb413a81..28142250de 100644 --- a/nptl/tst-default-attr.c +++ b/nptl/tst-default-attr.c @@ -1,6 +1,6 @@ /* Verify that pthread_[gs]etattr_default_np work correctly. - Copyright (C) 2013-2015 Free Software Foundation, Inc. + Copyright (C) 2013-2016 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 diff --git a/nptl/tst-detach1.c b/nptl/tst-detach1.c index 3090005a29..69d4d7c85d 100644 --- a/nptl/tst-detach1.c +++ b/nptl/tst-detach1.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003-2015 Free Software Foundation, Inc. +/* Copyright (C) 2003-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2003. diff --git a/nptl/tst-eintr1.c b/nptl/tst-eintr1.c index 19e01be957..11cd876a74 100644 --- a/nptl/tst-eintr1.c +++ b/nptl/tst-eintr1.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003-2015 Free Software Foundation, Inc. +/* Copyright (C) 2003-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2003. diff --git a/nptl/tst-eintr2.c b/nptl/tst-eintr2.c index 03fc95a995..7f50f4bcf4 100644 --- a/nptl/tst-eintr2.c +++ b/nptl/tst-eintr2.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003-2015 Free Software Foundation, Inc. +/* Copyright (C) 2003-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2003. diff --git a/nptl/tst-eintr3.c b/nptl/tst-eintr3.c index 14e3640423..d2c32b970a 100644 --- a/nptl/tst-eintr3.c +++ b/nptl/tst-eintr3.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003-2015 Free Software Foundation, Inc. +/* Copyright (C) 2003-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2003. diff --git a/nptl/tst-eintr4.c b/nptl/tst-eintr4.c index 9bc362ecc5..25fae34560 100644 --- a/nptl/tst-eintr4.c +++ b/nptl/tst-eintr4.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003-2015 Free Software Foundation, Inc. +/* Copyright (C) 2003-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2003. diff --git a/nptl/tst-eintr5.c b/nptl/tst-eintr5.c index c464f8b619..be6731c798 100644 --- a/nptl/tst-eintr5.c +++ b/nptl/tst-eintr5.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003-2015 Free Software Foundation, Inc. +/* Copyright (C) 2003-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2003. diff --git a/nptl/tst-exec1.c b/nptl/tst-exec1.c index d54655b3db..2d6e69cf55 100644 --- a/nptl/tst-exec1.c +++ b/nptl/tst-exec1.c @@ -1,5 +1,5 @@ /* Simple exec test, only a thread in the parent. - Copyright (C) 2002-2015 Free Software Foundation, Inc. + Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. diff --git a/nptl/tst-exec2.c b/nptl/tst-exec2.c index efd981b1b3..cb89945be4 100644 --- a/nptl/tst-exec2.c +++ b/nptl/tst-exec2.c @@ -1,5 +1,5 @@ /* Thread with running thread calls exec. - Copyright (C) 2002-2015 Free Software Foundation, Inc. + Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. diff --git a/nptl/tst-exec3.c b/nptl/tst-exec3.c index c17948e727..b6553e9a54 100644 --- a/nptl/tst-exec3.c +++ b/nptl/tst-exec3.c @@ -1,5 +1,5 @@ /* Thread calls exec. - Copyright (C) 2002-2015 Free Software Foundation, Inc. + Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. diff --git a/nptl/tst-exec4.c b/nptl/tst-exec4.c index 19750d5ef2..73f4eb2f1d 100644 --- a/nptl/tst-exec4.c +++ b/nptl/tst-exec4.c @@ -1,5 +1,5 @@ /* Signal handler and mask set in thread which calls exec. - Copyright (C) 2003-2015 Free Software Foundation, Inc. + Copyright (C) 2003-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2003. diff --git a/nptl/tst-exit1.c b/nptl/tst-exit1.c index fdbc1213f7..0894b42630 100644 --- a/nptl/tst-exit1.c +++ b/nptl/tst-exit1.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. diff --git a/nptl/tst-fini1.c b/nptl/tst-fini1.c index d9082dd376..a472366b3b 100644 --- a/nptl/tst-fini1.c +++ b/nptl/tst-fini1.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2004-2015 Free Software Foundation, Inc. +/* Copyright (C) 2004-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2004. diff --git a/nptl/tst-fini1mod.c b/nptl/tst-fini1mod.c index d400896eee..5e669a75d6 100644 --- a/nptl/tst-fini1mod.c +++ b/nptl/tst-fini1mod.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2004-2015 Free Software Foundation, Inc. +/* Copyright (C) 2004-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2004. diff --git a/nptl/tst-flock1.c b/nptl/tst-flock1.c index fae52dc7d3..cf02c10f93 100644 --- a/nptl/tst-flock1.c +++ b/nptl/tst-flock1.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. diff --git a/nptl/tst-flock2.c b/nptl/tst-flock2.c index 11743089bc..0df66eaa82 100644 --- a/nptl/tst-flock2.c +++ b/nptl/tst-flock2.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. diff --git a/nptl/tst-fork1.c b/nptl/tst-fork1.c index c882b7c63d..c10aff857b 100644 --- a/nptl/tst-fork1.c +++ b/nptl/tst-fork1.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Roland McGrath <roland@redhat.com>, 2002. diff --git a/nptl/tst-fork2.c b/nptl/tst-fork2.c index 7498891eb1..132e4d53e3 100644 --- a/nptl/tst-fork2.c +++ b/nptl/tst-fork2.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Roland McGrath <roland@redhat.com>, 2002. diff --git a/nptl/tst-fork3.c b/nptl/tst-fork3.c index 730559d9ba..7bb08451ac 100644 --- a/nptl/tst-fork3.c +++ b/nptl/tst-fork3.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Roland McGrath <roland@redhat.com>, 2002. diff --git a/nptl/tst-fork4.c b/nptl/tst-fork4.c index fa3efa6d36..64240eeaaf 100644 --- a/nptl/tst-fork4.c +++ b/nptl/tst-fork4.c @@ -1,5 +1,5 @@ /* Test of fork updating child universe's pthread structures. - Copyright (C) 2003-2015 Free Software Foundation, Inc. + Copyright (C) 2003-2016 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 diff --git a/nptl/tst-initializers1-c11.c b/nptl/tst-initializers1-c11.c new file mode 100644 index 0000000000..7c27c1d545 --- /dev/null +++ b/nptl/tst-initializers1-c11.c @@ -0,0 +1 @@ +#include "tst-initializers1.c" diff --git a/nptl/tst-initializers1-gnu11.c b/nptl/tst-initializers1-gnu11.c new file mode 100644 index 0000000000..7c27c1d545 --- /dev/null +++ b/nptl/tst-initializers1-gnu11.c @@ -0,0 +1 @@ +#include "tst-initializers1.c" diff --git a/nptl/tst-initializers1.c b/nptl/tst-initializers1.c index 5119ebfcb5..870a660e67 100644 --- a/nptl/tst-initializers1.c +++ b/nptl/tst-initializers1.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2005-2015 Free Software Foundation, Inc. +/* Copyright (C) 2005-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Jakub Jelinek <jakub@redhat.com>, 2005. @@ -46,9 +46,9 @@ do_test (void) if (rwl_writer.__data.__flags != PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP) return 6; - /* <bits/libc-lock.h> __libc_rwlock_init definition for libc.so + /* <libc-lock.h> __libc_rwlock_init definition for libc.so relies on PTHREAD_RWLOCK_INITIALIZER being all zeros. If - that ever changes, <bits/libc-lock.h> needs updating. */ + that ever changes, <libc-lock.h> needs updating. */ size_t i; for (i = 0; i < sizeof (rwl_normal); i++) if (((char *) &rwl_normal)[i] != '\0') diff --git a/nptl/tst-join1.c b/nptl/tst-join1.c index 7318b1550f..9e17cdecfc 100644 --- a/nptl/tst-join1.c +++ b/nptl/tst-join1.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. diff --git a/nptl/tst-join2.c b/nptl/tst-join2.c index f08d638c3e..0475d3811d 100644 --- a/nptl/tst-join2.c +++ b/nptl/tst-join2.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. diff --git a/nptl/tst-join3.c b/nptl/tst-join3.c index b064302d9e..0fb79eee76 100644 --- a/nptl/tst-join3.c +++ b/nptl/tst-join3.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. diff --git a/nptl/tst-join4.c b/nptl/tst-join4.c index ad30fce27d..b5ba2ea6e2 100644 --- a/nptl/tst-join4.c +++ b/nptl/tst-join4.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003-2015 Free Software Foundation, Inc. +/* Copyright (C) 2003-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2003. diff --git a/nptl/tst-join5.c b/nptl/tst-join5.c index b45d210629..ece82032e3 100644 --- a/nptl/tst-join5.c +++ b/nptl/tst-join5.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003-2015 Free Software Foundation, Inc. +/* Copyright (C) 2003-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2003. diff --git a/nptl/tst-join7.c b/nptl/tst-join7.c index 439d0fc9bb..54812c7e7f 100644 --- a/nptl/tst-join7.c +++ b/nptl/tst-join7.c @@ -1,6 +1,6 @@ /* Verify that TLS access in separate thread in a dlopened library does not deadlock. - Copyright (C) 2015 Free Software Foundation, Inc. + Copyright (C) 2015-2016 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 diff --git a/nptl/tst-join7mod.c b/nptl/tst-join7mod.c index a35db509f0..0beab5b2b2 100644 --- a/nptl/tst-join7mod.c +++ b/nptl/tst-join7mod.c @@ -1,6 +1,6 @@ /* Verify that TLS access in separate thread in a dlopened library does not deadlock - the module. - Copyright (C) 2015 Free Software Foundation, Inc. + Copyright (C) 2015-2016 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 diff --git a/nptl/tst-key1.c b/nptl/tst-key1.c index 76c2d1e760..0ed17873bb 100644 --- a/nptl/tst-key1.c +++ b/nptl/tst-key1.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. diff --git a/nptl/tst-key2.c b/nptl/tst-key2.c index be48635851..3142c86d38 100644 --- a/nptl/tst-key2.c +++ b/nptl/tst-key2.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. diff --git a/nptl/tst-key3.c b/nptl/tst-key3.c index 4c45728de7..a2985691df 100644 --- a/nptl/tst-key3.c +++ b/nptl/tst-key3.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. diff --git a/nptl/tst-key4.c b/nptl/tst-key4.c index f7c3364d0d..7b56a92594 100644 --- a/nptl/tst-key4.c +++ b/nptl/tst-key4.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003-2015 Free Software Foundation, Inc. +/* Copyright (C) 2003-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2003. diff --git a/nptl/tst-kill1.c b/nptl/tst-kill1.c index 1c5da54647..815f0c85ce 100644 --- a/nptl/tst-kill1.c +++ b/nptl/tst-kill1.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003-2015 Free Software Foundation, Inc. +/* Copyright (C) 2003-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2003. diff --git a/nptl/tst-kill2.c b/nptl/tst-kill2.c index a7788d6a29..c03a23b274 100644 --- a/nptl/tst-kill2.c +++ b/nptl/tst-kill2.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003-2015 Free Software Foundation, Inc. +/* Copyright (C) 2003-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2003. diff --git a/nptl/tst-kill3.c b/nptl/tst-kill3.c index f020fa967e..308cc5a24d 100644 --- a/nptl/tst-kill3.c +++ b/nptl/tst-kill3.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003-2015 Free Software Foundation, Inc. +/* Copyright (C) 2003-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2003. diff --git a/nptl/tst-kill4.c b/nptl/tst-kill4.c index e89184f425..0db2fd328e 100644 --- a/nptl/tst-kill4.c +++ b/nptl/tst-kill4.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003-2015 Free Software Foundation, Inc. +/* Copyright (C) 2003-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2003. diff --git a/nptl/tst-kill5.c b/nptl/tst-kill5.c index 0717c039d9..0a2dfa666f 100644 --- a/nptl/tst-kill5.c +++ b/nptl/tst-kill5.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003-2015 Free Software Foundation, Inc. +/* Copyright (C) 2003-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2003. diff --git a/nptl/tst-kill6.c b/nptl/tst-kill6.c index db135ef327..80a0771808 100644 --- a/nptl/tst-kill6.c +++ b/nptl/tst-kill6.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003-2015 Free Software Foundation, Inc. +/* Copyright (C) 2003-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2003. diff --git a/nptl/tst-mutex-errorcheck.c b/nptl/tst-mutex-errorcheck.c new file mode 100644 index 0000000000..7b756112a9 --- /dev/null +++ b/nptl/tst-mutex-errorcheck.c @@ -0,0 +1,61 @@ +/* Check that error checking mutexes are not subject to lock elision. + Copyright (C) 2016 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 + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#include <stdio.h> +#include <errno.h> +#include <time.h> +#include <pthread.h> + +static int +do_test (void) +{ + struct timespec tms = { 0 }; + pthread_mutex_t mutex; + pthread_mutexattr_t mutexattr; + int ret = 0; + + if (pthread_mutexattr_init (&mutexattr) != 0) + return 1; + if (pthread_mutexattr_settype (&mutexattr, PTHREAD_MUTEX_ERRORCHECK) != 0) + return 1; + + if (pthread_mutex_init (&mutex, &mutexattr) != 0) + return 1; + if (pthread_mutexattr_destroy (&mutexattr) != 0) + return 1; + + /* The call to pthread_mutex_timedlock erroneously enabled lock elision + on the mutex, which then triggered an assertion failure in + pthread_mutex_unlock. It would also defeat the error checking nature + of the mutex. */ + if (pthread_mutex_timedlock (&mutex, &tms) != 0) + return 1; + if (pthread_mutex_timedlock (&mutex, &tms) != EDEADLK) + { + printf ("Failed error checking on locked mutex\n"); + ret = 1; + } + + if (pthread_mutex_unlock (&mutex) != 0) + ret = 1; + + return ret; +} + +#define TEST_FUNCTION do_test () +#include "../test-skeleton.c" diff --git a/nptl/tst-mutex1.c b/nptl/tst-mutex1.c index 4b02207475..6cc8f9c3ca 100644 --- a/nptl/tst-mutex1.c +++ b/nptl/tst-mutex1.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. diff --git a/nptl/tst-mutex2.c b/nptl/tst-mutex2.c index 2cb7002b36..d8414aeb98 100644 --- a/nptl/tst-mutex2.c +++ b/nptl/tst-mutex2.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. diff --git a/nptl/tst-mutex3.c b/nptl/tst-mutex3.c index 6679241637..f4501f0127 100644 --- a/nptl/tst-mutex3.c +++ b/nptl/tst-mutex3.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. diff --git a/nptl/tst-mutex4.c b/nptl/tst-mutex4.c index 5cf04377e1..c75bffbfb2 100644 --- a/nptl/tst-mutex4.c +++ b/nptl/tst-mutex4.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. diff --git a/nptl/tst-mutex5.c b/nptl/tst-mutex5.c index 2e99e75cbc..888f023002 100644 --- a/nptl/tst-mutex5.c +++ b/nptl/tst-mutex5.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. diff --git a/nptl/tst-mutex6.c b/nptl/tst-mutex6.c index 1ac0d42321..1940687fee 100644 --- a/nptl/tst-mutex6.c +++ b/nptl/tst-mutex6.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. diff --git a/nptl/tst-mutex7.c b/nptl/tst-mutex7.c index 1b99acd23b..eff0134868 100644 --- a/nptl/tst-mutex7.c +++ b/nptl/tst-mutex7.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. diff --git a/nptl/tst-mutex8.c b/nptl/tst-mutex8.c index 3f56fa5672..a0329ef4da 100644 --- a/nptl/tst-mutex8.c +++ b/nptl/tst-mutex8.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003-2015 Free Software Foundation, Inc. +/* Copyright (C) 2003-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2003. diff --git a/nptl/tst-mutex9.c b/nptl/tst-mutex9.c index 868e79100c..5d47ff75fa 100644 --- a/nptl/tst-mutex9.c +++ b/nptl/tst-mutex9.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003-2015 Free Software Foundation, Inc. +/* Copyright (C) 2003-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2003. diff --git a/nptl/tst-mutexpp10.c b/nptl/tst-mutexpp10.c index e211e3620c..588de8d073 100644 --- a/nptl/tst-mutexpp10.c +++ b/nptl/tst-mutexpp10.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2006-2015 Free Software Foundation, Inc. +/* Copyright (C) 2006-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Jakub Jelinek <jakub@redhat.com>, 2006. diff --git a/nptl/tst-oddstacklimit.c b/nptl/tst-oddstacklimit.c index 61588a5d0e..a2a9274746 100644 --- a/nptl/tst-oddstacklimit.c +++ b/nptl/tst-oddstacklimit.c @@ -1,5 +1,5 @@ /* Test NPTL with stack limit that is not a multiple of the page size. - Copyright (C) 2012-2015 Free Software Foundation, Inc. + Copyright (C) 2012-2016 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 diff --git a/nptl/tst-once1.c b/nptl/tst-once1.c index a211a20a87..69ec5adb87 100644 --- a/nptl/tst-once1.c +++ b/nptl/tst-once1.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. diff --git a/nptl/tst-once2.c b/nptl/tst-once2.c index 25a29bf6c3..f463b180f6 100644 --- a/nptl/tst-once2.c +++ b/nptl/tst-once2.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. diff --git a/nptl/tst-once3.c b/nptl/tst-once3.c index f12417fa1a..ec941eee99 100644 --- a/nptl/tst-once3.c +++ b/nptl/tst-once3.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. diff --git a/nptl/tst-once4.c b/nptl/tst-once4.c index 54bc0f1214..8aa60320f7 100644 --- a/nptl/tst-once4.c +++ b/nptl/tst-once4.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003-2015 Free Software Foundation, Inc. +/* Copyright (C) 2003-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2003. diff --git a/nptl/tst-once5.cc b/nptl/tst-once5.cc index 60bc78a64a..978d8271bd 100644 --- a/nptl/tst-once5.cc +++ b/nptl/tst-once5.cc @@ -1,6 +1,5 @@ -/* Copyright (C) 2015 Free Software Foundation, Inc. +/* Copyright (C) 2015-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. - Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public diff --git a/nptl/tst-popen1.c b/nptl/tst-popen1.c index 1c53a9d8c9..87658147bd 100644 --- a/nptl/tst-popen1.c +++ b/nptl/tst-popen1.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003-2015 Free Software Foundation, Inc. +/* Copyright (C) 2003-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Jakub Jelinek <jakub@redhat.com>, 2003. diff --git a/nptl/tst-pthread-attr-affinity.c b/nptl/tst-pthread-attr-affinity.c index cd7cd22c7d..0f216072fe 100644 --- a/nptl/tst-pthread-attr-affinity.c +++ b/nptl/tst-pthread-attr-affinity.c @@ -1,7 +1,7 @@ /* Make sure that pthread_attr_getaffinity_np does not crash when the input cpuset size is smaller than that in the attribute structure. - Copyright (C) 2013-2015 Free Software Foundation, Inc. + Copyright (C) 2013-2016 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 diff --git a/nptl/tst-pthread-getattr.c b/nptl/tst-pthread-getattr.c index a82a0dc440..59a3cebacf 100644 --- a/nptl/tst-pthread-getattr.c +++ b/nptl/tst-pthread-getattr.c @@ -1,7 +1,7 @@ /* Make sure that the stackaddr returned by pthread_getattr_np is reachable. - Copyright (C) 2012-2015 Free Software Foundation, Inc. + Copyright (C) 2012-2016 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 diff --git a/nptl/tst-pthread-mutexattr.c b/nptl/tst-pthread-mutexattr.c index 10ebe50031..91a54e1bac 100644 --- a/nptl/tst-pthread-mutexattr.c +++ b/nptl/tst-pthread-mutexattr.c @@ -1,6 +1,6 @@ /* Make sure that pthread_mutexattr_gettype returns a valid kind. - Copyright (C) 2015 Free Software Foundation, Inc. + Copyright (C) 2015-2016 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 diff --git a/nptl/tst-raise1.c b/nptl/tst-raise1.c index 9f6abdce08..889cc6288a 100644 --- a/nptl/tst-raise1.c +++ b/nptl/tst-raise1.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003-2015 Free Software Foundation, Inc. +/* Copyright (C) 2003-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Jakub Jelinek <jakub@redhat.com>, 2003. diff --git a/nptl/tst-robust1.c b/nptl/tst-robust1.c index 4e50c96c06..2bafc0cbaf 100644 --- a/nptl/tst-robust1.c +++ b/nptl/tst-robust1.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2005-2015 Free Software Foundation, Inc. +/* Copyright (C) 2005-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2005. diff --git a/nptl/tst-robust7.c b/nptl/tst-robust7.c index e20ff2b24b..dcc0d47948 100644 --- a/nptl/tst-robust7.c +++ b/nptl/tst-robust7.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2005-2015 Free Software Foundation, Inc. +/* Copyright (C) 2005-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2005. diff --git a/nptl/tst-rwlock1.c b/nptl/tst-rwlock1.c index d9d624b203..d7e96768fb 100644 --- a/nptl/tst-rwlock1.c +++ b/nptl/tst-rwlock1.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. diff --git a/nptl/tst-rwlock10.c b/nptl/tst-rwlock10.c index db629a272d..9c8de4490f 100644 --- a/nptl/tst-rwlock10.c +++ b/nptl/tst-rwlock10.c @@ -1,5 +1,5 @@ /* Test program for timedout read/write lock functions. - Copyright (C) 2003-2015 Free Software Foundation, Inc. + Copyright (C) 2003-2016 Free Software Foundation, Inc. Contributed by Ulrich Drepper <drepper@redhat.com>, 2003. The GNU C Library is free software; you can redistribute it and/or diff --git a/nptl/tst-rwlock11.c b/nptl/tst-rwlock11.c index c08f47e2c3..882aead668 100644 --- a/nptl/tst-rwlock11.c +++ b/nptl/tst-rwlock11.c @@ -1,5 +1,5 @@ /* Test program for timedout read/write lock functions. - Copyright (C) 2003-2015 Free Software Foundation, Inc. + Copyright (C) 2003-2016 Free Software Foundation, Inc. Contributed by Ulrich Drepper <drepper@redhat.com>, 2003. The GNU C Library is free software; you can redistribute it and/or diff --git a/nptl/tst-rwlock12.c b/nptl/tst-rwlock12.c index afa8174eaa..49d4375e20 100644 --- a/nptl/tst-rwlock12.c +++ b/nptl/tst-rwlock12.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. diff --git a/nptl/tst-rwlock13.c b/nptl/tst-rwlock13.c index 76380f4029..2bdc9371f1 100644 --- a/nptl/tst-rwlock13.c +++ b/nptl/tst-rwlock13.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2004-2015 Free Software Foundation, Inc. +/* Copyright (C) 2004-2016 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 diff --git a/nptl/tst-rwlock14.c b/nptl/tst-rwlock14.c index 9dc1b26cbc..6f71f8257c 100644 --- a/nptl/tst-rwlock14.c +++ b/nptl/tst-rwlock14.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2004-2015 Free Software Foundation, Inc. +/* Copyright (C) 2004-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2004. diff --git a/nptl/tst-rwlock15.c b/nptl/tst-rwlock15.c index b292701e21..7ff32da13c 100644 --- a/nptl/tst-rwlock15.c +++ b/nptl/tst-rwlock15.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2015 Free Software Foundation, Inc. +/* Copyright (C) 2015-2016 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 diff --git a/nptl/tst-rwlock16.c b/nptl/tst-rwlock16.c index 8e661db2d2..2bec3f80bc 100644 --- a/nptl/tst-rwlock16.c +++ b/nptl/tst-rwlock16.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2015 Free Software Foundation, Inc. +/* Copyright (C) 2015-2016 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 diff --git a/nptl/tst-rwlock2.c b/nptl/tst-rwlock2.c index 36450cea5c..2b1222e8ee 100644 --- a/nptl/tst-rwlock2.c +++ b/nptl/tst-rwlock2.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. diff --git a/nptl/tst-rwlock3.c b/nptl/tst-rwlock3.c index 22f23247f7..48df8079fd 100644 --- a/nptl/tst-rwlock3.c +++ b/nptl/tst-rwlock3.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. diff --git a/nptl/tst-rwlock4.c b/nptl/tst-rwlock4.c index 6c4ddc61d2..36ae257a6f 100644 --- a/nptl/tst-rwlock4.c +++ b/nptl/tst-rwlock4.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. diff --git a/nptl/tst-rwlock5.c b/nptl/tst-rwlock5.c index b3a2fc33e6..b6c5d8a247 100644 --- a/nptl/tst-rwlock5.c +++ b/nptl/tst-rwlock5.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. diff --git a/nptl/tst-rwlock6.c b/nptl/tst-rwlock6.c index 7b46091ffb..d8852e3489 100644 --- a/nptl/tst-rwlock6.c +++ b/nptl/tst-rwlock6.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. diff --git a/nptl/tst-rwlock7.c b/nptl/tst-rwlock7.c index 0d2d5facff..cecd2927b0 100644 --- a/nptl/tst-rwlock7.c +++ b/nptl/tst-rwlock7.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. diff --git a/nptl/tst-rwlock8.c b/nptl/tst-rwlock8.c index 8db1f8d64a..ba9dbc93b5 100644 --- a/nptl/tst-rwlock8.c +++ b/nptl/tst-rwlock8.c @@ -1,5 +1,5 @@ /* Test program for timedout read/write lock functions. - Copyright (C) 2000-2015 Free Software Foundation, Inc. + Copyright (C) 2000-2016 Free Software Foundation, Inc. Contributed by Ulrich Drepper <drepper@redhat.com>, 2000. The GNU C Library is free software; you can redistribute it and/or diff --git a/nptl/tst-rwlock9.c b/nptl/tst-rwlock9.c index e7cf7314a4..40d5c47462 100644 --- a/nptl/tst-rwlock9.c +++ b/nptl/tst-rwlock9.c @@ -1,5 +1,5 @@ /* Test program for timedout read/write lock functions. - Copyright (C) 2000-2015 Free Software Foundation, Inc. + Copyright (C) 2000-2016 Free Software Foundation, Inc. Contributed by Ulrich Drepper <drepper@redhat.com>, 2000. The GNU C Library is free software; you can redistribute it and/or diff --git a/nptl/tst-sched1.c b/nptl/tst-sched1.c index 1a269ff368..74bce733e4 100644 --- a/nptl/tst-sched1.c +++ b/nptl/tst-sched1.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003-2015 Free Software Foundation, Inc. +/* Copyright (C) 2003-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. diff --git a/nptl/tst-sem1.c b/nptl/tst-sem1.c index 9b678a29de..efedc653ce 100644 --- a/nptl/tst-sem1.c +++ b/nptl/tst-sem1.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. diff --git a/nptl/tst-sem10.c b/nptl/tst-sem10.c index 9d17969866..89e0e0e72e 100644 --- a/nptl/tst-sem10.c +++ b/nptl/tst-sem10.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2007-2015 Free Software Foundation, Inc. +/* Copyright (C) 2007-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Jakub Jelinek <jakub@redhat.com>, 2007. diff --git a/nptl/tst-sem14.c b/nptl/tst-sem14.c index c033602a0b..9aa1ccd7c7 100644 --- a/nptl/tst-sem14.c +++ b/nptl/tst-sem14.c @@ -1,5 +1,5 @@ /* Test for sem_post race: bug 14532. - Copyright (C) 2012-2015 Free Software Foundation, Inc. + Copyright (C) 2012-2016 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 diff --git a/nptl/tst-sem15.c b/nptl/tst-sem15.c index 3df9561aae..ca7d4915c1 100644 --- a/nptl/tst-sem15.c +++ b/nptl/tst-sem15.c @@ -1,5 +1,5 @@ /* Test for SEM_VALUE_MAX overflow detection: BZ #18434. - Copyright (C) 2015 Free Software Foundation, Inc. + Copyright (C) 2015-2016 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 diff --git a/nptl/tst-sem2.c b/nptl/tst-sem2.c index 45b10b42cc..301dde7948 100644 --- a/nptl/tst-sem2.c +++ b/nptl/tst-sem2.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. diff --git a/nptl/tst-sem3.c b/nptl/tst-sem3.c index 3106452ba3..eb934dfb77 100644 --- a/nptl/tst-sem3.c +++ b/nptl/tst-sem3.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. diff --git a/nptl/tst-sem4.c b/nptl/tst-sem4.c index 69ef11af97..044747f02b 100644 --- a/nptl/tst-sem4.c +++ b/nptl/tst-sem4.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. diff --git a/nptl/tst-sem5.c b/nptl/tst-sem5.c index 46ea617fe4..5ecf95234d 100644 --- a/nptl/tst-sem5.c +++ b/nptl/tst-sem5.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. diff --git a/nptl/tst-sem6.c b/nptl/tst-sem6.c index 26d300c50a..23061e6eb1 100644 --- a/nptl/tst-sem6.c +++ b/nptl/tst-sem6.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003-2015 Free Software Foundation, Inc. +/* Copyright (C) 2003-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2003. diff --git a/nptl/tst-sem7.c b/nptl/tst-sem7.c index 61a90a5d53..2d083ffc61 100644 --- a/nptl/tst-sem7.c +++ b/nptl/tst-sem7.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003-2015 Free Software Foundation, Inc. +/* Copyright (C) 2003-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2003. diff --git a/nptl/tst-sem8.c b/nptl/tst-sem8.c index 49286de992..044598e0da 100644 --- a/nptl/tst-sem8.c +++ b/nptl/tst-sem8.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003-2015 Free Software Foundation, Inc. +/* Copyright (C) 2003-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2003. diff --git a/nptl/tst-sem9.c b/nptl/tst-sem9.c index a6dbec47b9..18b04517d9 100644 --- a/nptl/tst-sem9.c +++ b/nptl/tst-sem9.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003-2015 Free Software Foundation, Inc. +/* Copyright (C) 2003-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2003. diff --git a/nptl/tst-setuid1.c b/nptl/tst-setuid1.c index 2d4668e52d..46a116812b 100644 --- a/nptl/tst-setuid1.c +++ b/nptl/tst-setuid1.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2004-2015 Free Software Foundation, Inc. +/* Copyright (C) 2004-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Jakub Jelinek <jaku@redhat.com>, 2004. diff --git a/nptl/tst-setuid2.c b/nptl/tst-setuid2.c index fe14dc5c0b..dd25dc8b2a 100644 --- a/nptl/tst-setuid2.c +++ b/nptl/tst-setuid2.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2014-2015 Free Software Foundation, Inc. +/* Copyright (C) 2014-2016 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 diff --git a/nptl/tst-setuid3.c b/nptl/tst-setuid3.c index 553febc7dc..40dbb2a62c 100644 --- a/nptl/tst-setuid3.c +++ b/nptl/tst-setuid3.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2014-2015 Free Software Foundation, Inc. +/* Copyright (C) 2014-2016 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 @@ -33,14 +33,21 @@ static pthread_barrier_t barrier2; #define FAIL_ERR(fmt, ...) \ do { printf ("FAIL: " fmt ": %m\n", __VA_ARGS__); _exit (1); } while (0) +/* True if x is not a successful return code from pthread_barrier_wait. */ +static inline bool +is_invalid_barrier_ret (int x) +{ + return x != 0 && x != PTHREAD_BARRIER_SERIAL_THREAD; +} + static void * thread_func (void *ctx __attribute__ ((unused))) { int ret = pthread_barrier_wait (&barrier1); - if (ret != PTHREAD_BARRIER_SERIAL_THREAD && ret != 0) + if (is_invalid_barrier_ret (ret)) FAIL ("pthread_barrier_wait (barrier1) (on thread): %d", ret); ret = pthread_barrier_wait (&barrier2); - if (ret != PTHREAD_BARRIER_SERIAL_THREAD && ret != 0) + if (is_invalid_barrier_ret (ret)) FAIL ("pthread_barrier_wait (barrier2) (on thread): %d", ret); return NULL; } @@ -86,7 +93,7 @@ do_test (void) /* Ensure that the thread is running properly. */ ret = pthread_barrier_wait (&barrier1); - if (ret != 0) + if (is_invalid_barrier_ret (ret)) FAIL ("pthread_barrier_wait (barrier1): %d", ret); setuid_failure (2); @@ -97,10 +104,11 @@ do_test (void) /* Shutdown. */ ret = pthread_barrier_wait (&barrier2); - if (ret != PTHREAD_BARRIER_SERIAL_THREAD && ret != 0) + if (is_invalid_barrier_ret (ret)) FAIL ("pthread_barrier_wait (barrier2): %d", ret); - if (ret != PTHREAD_BARRIER_SERIAL_THREAD && ret != 0) + ret = pthread_join (thread, NULL); + if (ret != 0) FAIL ("pthread_join: %d", ret); return 0; diff --git a/nptl/tst-signal1.c b/nptl/tst-signal1.c index 1ffacbd60b..d81c522026 100644 --- a/nptl/tst-signal1.c +++ b/nptl/tst-signal1.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. diff --git a/nptl/tst-signal2.c b/nptl/tst-signal2.c index 98067701f3..ae5178fd18 100644 --- a/nptl/tst-signal2.c +++ b/nptl/tst-signal2.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. diff --git a/nptl/tst-signal3.c b/nptl/tst-signal3.c index 90b2e71b28..11ec5f690e 100644 --- a/nptl/tst-signal3.c +++ b/nptl/tst-signal3.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. diff --git a/nptl/tst-signal4.c b/nptl/tst-signal4.c index d51b12243f..87e465494a 100644 --- a/nptl/tst-signal4.c +++ b/nptl/tst-signal4.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003-2015 Free Software Foundation, Inc. +/* Copyright (C) 2003-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2003. diff --git a/nptl/tst-signal5.c b/nptl/tst-signal5.c index a0c165dcc7..774484cfe8 100644 --- a/nptl/tst-signal5.c +++ b/nptl/tst-signal5.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003-2015 Free Software Foundation, Inc. +/* Copyright (C) 2003-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2003. diff --git a/nptl/tst-signal6.c b/nptl/tst-signal6.c index b98947a9e7..0b350f42e1 100644 --- a/nptl/tst-signal6.c +++ b/nptl/tst-signal6.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003-2015 Free Software Foundation, Inc. +/* Copyright (C) 2003-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2003. diff --git a/nptl/tst-signal7.c b/nptl/tst-signal7.c index 1fbf3dbf72..6c9f2cebbe 100644 --- a/nptl/tst-signal7.c +++ b/nptl/tst-signal7.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2005-2015 Free Software Foundation, Inc. +/* Copyright (C) 2005-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2005. diff --git a/nptl/tst-spin1.c b/nptl/tst-spin1.c index 2969b20604..4a25434429 100644 --- a/nptl/tst-spin1.c +++ b/nptl/tst-spin1.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. diff --git a/nptl/tst-spin2.c b/nptl/tst-spin2.c index a702eb5b3e..8739c820b7 100644 --- a/nptl/tst-spin2.c +++ b/nptl/tst-spin2.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. diff --git a/nptl/tst-spin3.c b/nptl/tst-spin3.c index 4eb62988f8..8964ecca8b 100644 --- a/nptl/tst-spin3.c +++ b/nptl/tst-spin3.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. diff --git a/nptl/tst-stack1.c b/nptl/tst-stack1.c index 6a11dafa11..3facb0b29d 100644 --- a/nptl/tst-stack1.c +++ b/nptl/tst-stack1.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. diff --git a/nptl/tst-stack2.c b/nptl/tst-stack2.c index d8fab0c7c1..e9239a8ed3 100644 --- a/nptl/tst-stack2.c +++ b/nptl/tst-stack2.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003-2015 Free Software Foundation, Inc. +/* Copyright (C) 2003-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Jakub Jelinek <jakub@redhat.com>, 2003. diff --git a/nptl/tst-stack3.c b/nptl/tst-stack3.c index c4cdaca4a2..907f5560c9 100644 --- a/nptl/tst-stack3.c +++ b/nptl/tst-stack3.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003-2015 Free Software Foundation, Inc. +/* Copyright (C) 2003-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Jakub Jelinek <jakub@redhat.com>, 2003. diff --git a/nptl/tst-stack4.c b/nptl/tst-stack4.c index d44f1d6d03..08f888b104 100644 --- a/nptl/tst-stack4.c +++ b/nptl/tst-stack4.c @@ -1,6 +1,6 @@ /* Test DTV size oveflow when pthread_create reuses old DTV and TLS is used by dlopened shared object. - Copyright (C) 2014-2015 Free Software Foundation, Inc. + Copyright (C) 2014-2016 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 diff --git a/nptl/tst-stack4mod.c b/nptl/tst-stack4mod.c index f37b5b9589..e3f0eeba62 100644 --- a/nptl/tst-stack4mod.c +++ b/nptl/tst-stack4mod.c @@ -1,5 +1,5 @@ /* This tests DTV usage with TLS in dlopened shared object. - Copyright (C) 2014-2015 Free Software Foundation, Inc. + Copyright (C) 2014-2016 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 diff --git a/nptl/tst-stackguard1.c b/nptl/tst-stackguard1.c index 8e4e964fdb..497de8b369 100644 --- a/nptl/tst-stackguard1.c +++ b/nptl/tst-stackguard1.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2005-2015 Free Software Foundation, Inc. +/* Copyright (C) 2005-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Jakub Jelinek <jakub@redhat.com>, 2005. diff --git a/nptl/tst-stdio1.c b/nptl/tst-stdio1.c index 555f9da356..2d44c16a77 100644 --- a/nptl/tst-stdio1.c +++ b/nptl/tst-stdio1.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. diff --git a/nptl/tst-stdio2.c b/nptl/tst-stdio2.c index 6ecf616fc9..6168d273e4 100644 --- a/nptl/tst-stdio2.c +++ b/nptl/tst-stdio2.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. diff --git a/nptl/tst-sysconf.c b/nptl/tst-sysconf.c index 0b0d3e768b..b3b6299612 100644 --- a/nptl/tst-sysconf.c +++ b/nptl/tst-sysconf.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. diff --git a/nptl/tst-thread_local1.cc b/nptl/tst-thread_local1.cc new file mode 100644 index 0000000000..07beef091a --- /dev/null +++ b/nptl/tst-thread_local1.cc @@ -0,0 +1,199 @@ +/* Test basic thread_local support. + Copyright (C) 2015-2016 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 + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#include <errno.h> +#include <pthread.h> +#include <stdio.h> +#include <string.h> + +#include <functional> +#include <string> +#include <thread> + +struct counter +{ + int constructed {}; + int destructed {}; + + void reset (); +}; + +void +counter::reset () +{ + constructed = 0; + destructed = 0; +} + +static std::string +to_string (const counter &c) +{ + char buf[128]; + snprintf (buf, sizeof (buf), "%d/%d", + c.constructed, c.destructed); + return buf; +} + +template <counter *Counter> +struct counting +{ + counting () __attribute__ ((noinline, noclone)); + ~counting () __attribute__ ((noinline, noclone)); + void operation () __attribute__ ((noinline, noclone)); +}; + +template<counter *Counter> +__attribute__ ((noinline, noclone)) +counting<Counter>::counting () +{ + ++Counter->constructed; +} + +template<counter *Counter> +__attribute__ ((noinline, noclone)) +counting<Counter>::~counting () +{ + ++Counter->destructed; +} + +template<counter *Counter> +void __attribute__ ((noinline, noclone)) +counting<Counter>::operation () +{ + // Optimization barrier. + asm (""); +} + +static counter counter_static; +static counter counter_anonymous_namespace; +static counter counter_extern; +static counter counter_function_local; +static bool errors (false); + +static std::string +all_counters () +{ + return to_string (counter_static) + + ' ' + to_string (counter_anonymous_namespace) + + ' ' + to_string (counter_extern) + + ' ' + to_string (counter_function_local); +} + +static void +check_counters (const char *name, const char *expected) +{ + std::string actual{all_counters ()}; + if (actual != expected) + { + printf ("error: %s: (%s) != (%s)\n", + name, actual.c_str (), expected); + errors = true; + } +} + +static void +reset_all () +{ + counter_static.reset (); + counter_anonymous_namespace.reset (); + counter_extern.reset (); + counter_function_local.reset (); +} + +static thread_local counting<&counter_static> counting_static; +namespace { + thread_local counting<&counter_anonymous_namespace> + counting_anonymous_namespace; +} +extern thread_local counting<&counter_extern> counting_extern; +thread_local counting<&counter_extern> counting_extern; + +static void * +thread_without_access (void *) +{ + return nullptr; +} + +static void * +thread_with_access (void *) +{ + thread_local counting<&counter_function_local> counting_function_local; + counting_function_local.operation (); + check_counters ("early in thread_with_access", "0/0 0/0 0/0 1/0"); + counting_static.operation (); + counting_anonymous_namespace.operation (); + counting_extern.operation (); + check_counters ("in thread_with_access", "1/0 1/0 1/0 1/0"); + return nullptr; +} + +static int +do_test (void) +{ + std::function<void (void *(void *))> do_pthread = + [](void *(func) (void *)) + { + pthread_t thr; + int ret = pthread_create (&thr, nullptr, func, nullptr); + if (ret != 0) + { + errno = ret; + printf ("error: pthread_create: %m\n"); + errors = true; + return; + } + ret = pthread_join (thr, nullptr); + if (ret != 0) + { + errno = ret; + printf ("error: pthread_join: %m\n"); + errors = true; + return; + } + }; + std::function<void (void *(void *))> do_std_thread = + [](void *(func) (void *)) + { + std::thread thr{[func] {func (nullptr);}}; + thr.join (); + }; + + std::array<std::pair<const char *, std::function<void (void *(void *))>>, 2> + do_thread_X + {{ + {"pthread_create", do_pthread}, + {"std::thread", do_std_thread}, + }}; + + for (auto do_thread : do_thread_X) + { + printf ("info: testing %s\n", do_thread.first); + check_counters ("initial", "0/0 0/0 0/0 0/0"); + do_thread.second (thread_without_access); + check_counters ("after thread_without_access", "0/0 0/0 0/0 0/0"); + reset_all (); + do_thread.second (thread_with_access); + check_counters ("after thread_with_access", "1/1 1/1 1/1 1/1"); + reset_all (); + } + + return errors; +} + +#define TEST_FUNCTION do_test () +#include "../test-skeleton.c" diff --git a/nptl/tst-tls1.c b/nptl/tst-tls1.c index 3221748af8..9eadf66707 100644 --- a/nptl/tst-tls1.c +++ b/nptl/tst-tls1.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003-2015 Free Software Foundation, Inc. +/* Copyright (C) 2003-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2003. diff --git a/nptl/tst-tls2.c b/nptl/tst-tls2.c index b15b3d3159..eb6d8a336b 100644 --- a/nptl/tst-tls2.c +++ b/nptl/tst-tls2.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003-2015 Free Software Foundation, Inc. +/* Copyright (C) 2003-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2003. diff --git a/nptl/tst-tls3.c b/nptl/tst-tls3.c index d504054c05..982c1fdd4c 100644 --- a/nptl/tst-tls3.c +++ b/nptl/tst-tls3.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003-2015 Free Software Foundation, Inc. +/* Copyright (C) 2003-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2003. diff --git a/nptl/tst-tls3mod.c b/nptl/tst-tls3mod.c index 97778a4a80..76253de4b9 100644 --- a/nptl/tst-tls3mod.c +++ b/nptl/tst-tls3mod.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003-2015 Free Software Foundation, Inc. +/* Copyright (C) 2003-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2003. diff --git a/nptl/tst-tls4.c b/nptl/tst-tls4.c index 1b8e734ea0..09a423b923 100644 --- a/nptl/tst-tls4.c +++ b/nptl/tst-tls4.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003-2015 Free Software Foundation, Inc. +/* Copyright (C) 2003-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Jakub Jelinek <jakub@redhat.com>, 2003. diff --git a/nptl/tst-tls4moda.c b/nptl/tst-tls4moda.c index 35a1a267ab..3c5cf391d6 100644 --- a/nptl/tst-tls4moda.c +++ b/nptl/tst-tls4moda.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003-2015 Free Software Foundation, Inc. +/* Copyright (C) 2003-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Jakub Jelinek <jakub@redhat.com>, 2003. diff --git a/nptl/tst-tls4modb.c b/nptl/tst-tls4modb.c index 2e2ee7a99f..8ca7f71d4d 100644 --- a/nptl/tst-tls4modb.c +++ b/nptl/tst-tls4modb.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003-2015 Free Software Foundation, Inc. +/* Copyright (C) 2003-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Jakub Jelinek <jakub@redhat.com>, 2003. diff --git a/nptl/tst-tls5.c b/nptl/tst-tls5.c index 1a91517874..ca8242d3f4 100644 --- a/nptl/tst-tls5.c +++ b/nptl/tst-tls5.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003-2015 Free Software Foundation, Inc. +/* Copyright (C) 2003-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Jakub Jelinek <jakub@redhat.com>, 2003. diff --git a/nptl/tst-tls6.sh b/nptl/tst-tls6.sh index 3533474a08..f828008303 100755 --- a/nptl/tst-tls6.sh +++ b/nptl/tst-tls6.sh @@ -1,6 +1,6 @@ -#! /bin/bash +#!/bin/bash # A tls test. -# Copyright (C) 2003-2015 Free Software Foundation, Inc. +# Copyright (C) 2003-2016 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 diff --git a/nptl/tst-tpp.h b/nptl/tst-tpp.h index 5c6c2f650a..8dc0dc9229 100644 --- a/nptl/tst-tpp.h +++ b/nptl/tst-tpp.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2006-2015 Free Software Foundation, Inc. +/* Copyright (C) 2006-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Jakub Jelinek <jakub@redhat.com>, 2006. diff --git a/nptl/tst-tsd1.c b/nptl/tst-tsd1.c index c2b53e0421..f4ef953137 100644 --- a/nptl/tst-tsd1.c +++ b/nptl/tst-tsd1.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. diff --git a/nptl/tst-tsd2.c b/nptl/tst-tsd2.c index a81e47b443..d6f6ff7370 100644 --- a/nptl/tst-tsd2.c +++ b/nptl/tst-tsd2.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. diff --git a/nptl/tst-tsd3.c b/nptl/tst-tsd3.c index a853ad68e7..2c0d25db1a 100644 --- a/nptl/tst-tsd3.c +++ b/nptl/tst-tsd3.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003-2015 Free Software Foundation, Inc. +/* Copyright (C) 2003-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2003. diff --git a/nptl/tst-tsd4.c b/nptl/tst-tsd4.c index b4497b8cc6..86e0164eff 100644 --- a/nptl/tst-tsd4.c +++ b/nptl/tst-tsd4.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003-2015 Free Software Foundation, Inc. +/* Copyright (C) 2003-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2003. diff --git a/nptl/tst-tsd5.c b/nptl/tst-tsd5.c index 6da51255eb..09e8ccc5f3 100644 --- a/nptl/tst-tsd5.c +++ b/nptl/tst-tsd5.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2004-2015 Free Software Foundation, Inc. +/* Copyright (C) 2004-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2004. diff --git a/nptl/tst-typesizes.c b/nptl/tst-typesizes.c index 678ee3e2a1..cb07c9de9e 100644 --- a/nptl/tst-typesizes.c +++ b/nptl/tst-typesizes.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2005-2015 Free Software Foundation, Inc. +/* Copyright (C) 2005-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2005. diff --git a/nptl/tst-umask1.c b/nptl/tst-umask1.c index 786fbd50b2..50cfa359ec 100644 --- a/nptl/tst-umask1.c +++ b/nptl/tst-umask1.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003-2015 Free Software Foundation, Inc. +/* Copyright (C) 2003-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2003. diff --git a/nptl/tst-unload.c b/nptl/tst-unload.c index 7757c61ed3..e78ef5f710 100644 --- a/nptl/tst-unload.c +++ b/nptl/tst-unload.c @@ -1,5 +1,5 @@ /* Tests for non-unloading of libpthread. - Copyright (C) 2000-2015 Free Software Foundation, Inc. + Copyright (C) 2000-2016 Free Software Foundation, Inc. Contributed by Ulrich Drepper <drepper@redhat.com>, 2000. The GNU C Library is free software; you can redistribute it and/or diff --git a/nptl/unregister-atfork.c b/nptl/unregister-atfork.c index 6d08ed737e..4c84894ded 100644 --- a/nptl/unregister-atfork.c +++ b/nptl/unregister-atfork.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2015 Free Software Foundation, Inc. +/* Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -24,8 +24,7 @@ void -__unregister_atfork (dso_handle) - void *dso_handle; +__unregister_atfork (void *dso_handle) { /* Check whether there is any entry in the list which we have to remove. It is likely that this is not the case so don't bother diff --git a/nptl/unwind.c b/nptl/unwind.c index 904187ed55..a0c70d2433 100644 --- a/nptl/unwind.c +++ b/nptl/unwind.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003-2015 Free Software Foundation, Inc. +/* Copyright (C) 2003-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com> and Richard Henderson <rth@redhat.com>, 2003. @@ -25,8 +25,6 @@ #include "pthreadP.h" #include <jmpbuf-unwind.h> -#ifdef HAVE_FORCED_UNWIND - #ifdef _STACK_GROWS_DOWN # define FRAME_LEFT(frame, other, adj) \ ((uintptr_t) frame - adj >= (uintptr_t) other - adj) @@ -107,8 +105,6 @@ unwind_cleanup (_Unwind_Reason_Code reason, struct _Unwind_Exception *exc) __libc_fatal ("FATAL: exception not rethrown\n"); } -#endif /* have forced unwind */ - void __cleanup_fct_attribute __attribute ((noreturn)) @@ -117,42 +113,12 @@ __pthread_unwind (__pthread_unwind_buf_t *buf) struct pthread_unwind_buf *ibuf = (struct pthread_unwind_buf *) buf; struct pthread *self = THREAD_SELF; -#ifdef HAVE_FORCED_UNWIND /* This is not a catchable exception, so don't provide any details about the exception type. We do need to initialize the field though. */ THREAD_SETMEM (self, exc.exception_class, 0); THREAD_SETMEM (self, exc.exception_cleanup, &unwind_cleanup); _Unwind_ForcedUnwind (&self->exc, unwind_stop, ibuf); -#else - /* Handle the compatibility stuff first. Execute all handlers - registered with the old method. We don't execute them in order, - instead, they will run first. */ - struct _pthread_cleanup_buffer *oldp = ibuf->priv.data.cleanup; - struct _pthread_cleanup_buffer *curp = THREAD_GETMEM (self, cleanup); - - if (curp != oldp) - { - do - { - /* Pointer to the next element. */ - struct _pthread_cleanup_buffer *nextp = curp->__prev; - - /* Call the handler. */ - curp->__routine (curp->__arg); - - /* To the next. */ - curp = nextp; - } - while (curp != oldp); - - /* Mark the current element as handled. */ - THREAD_SETMEM (self, cleanup, curp); - } - - /* We simply jump to the registered setjmp buffer. */ - __libc_unwind_longjmp ((struct __jmp_buf_tag *) ibuf->cancel_jmp_buf, 1); -#endif /* NOTREACHED */ /* We better do not get here. */ diff --git a/nptl/vars.c b/nptl/vars.c index f14525863f..f09c7125fd 100644 --- a/nptl/vars.c +++ b/nptl/vars.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2004-2015 Free Software Foundation, Inc. +/* Copyright (C) 2004-2016 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 diff --git a/nptl/version.c b/nptl/version.c index cfa2acb3d8..957595bc34 100644 --- a/nptl/version.c +++ b/nptl/version.c @@ -1,5 +1,5 @@ /* Entry point for libpthread DSO. - Copyright (C) 2002-2015 Free Software Foundation, Inc. + Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -23,13 +23,11 @@ static const char banner[] = #include "banner.h" -"Copyright (C) 2015 Free Software Foundation, Inc.\n\ +"Copyright (C) 2016 Free Software Foundation, Inc.\n\ This is free software; see the source for copying conditions.\n\ There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A\n\ PARTICULAR PURPOSE.\n" -#ifdef HAVE_FORCED_UNWIND "Forced unwind support included.\n" -#endif ; |