From f3a01e0fe21cc9942358c1564b34dcebe963b579 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Thu, 8 Sep 2005 03:56:33 +0000 Subject: sync misc trivial touchups from glibc --- .../linuxthreads/sysdeps/pthread/bits/libc-lock.h | 3 ++- .../linuxthreads/sysdeps/pthread/bits/libc-tsd.h | 2 +- .../sysdeps/pthread/bits/pthreadtypes.h | 28 ++++++++++++++++++---- 3 files changed, 27 insertions(+), 6 deletions(-) (limited to 'libpthread/linuxthreads/sysdeps/pthread/bits') diff --git a/libpthread/linuxthreads/sysdeps/pthread/bits/libc-lock.h b/libpthread/linuxthreads/sysdeps/pthread/bits/libc-lock.h index 4e884a030..e2b267d32 100644 --- a/libpthread/linuxthreads/sysdeps/pthread/bits/libc-lock.h +++ b/libpthread/linuxthreads/sysdeps/pthread/bits/libc-lock.h @@ -1,5 +1,6 @@ /* libc-internal interface for mutex locks. LinuxThreads version. - Copyright (C) 1996,1997,1998,1999,2000,2001 Free Software Foundation, Inc. + Copyright (C) 1996,1997,1998,1999,2000,2001,2002,2003 + 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/libpthread/linuxthreads/sysdeps/pthread/bits/libc-tsd.h b/libpthread/linuxthreads/sysdeps/pthread/bits/libc-tsd.h index 35a6a19a6..efd0c83be 100644 --- a/libpthread/linuxthreads/sysdeps/pthread/bits/libc-tsd.h +++ b/libpthread/linuxthreads/sysdeps/pthread/bits/libc-tsd.h @@ -1,5 +1,5 @@ /* libc-internal interface for thread-specific data. LinuxThreads version. - Copyright (C) 1997,98,99,2001,02 Free Software Foundation, Inc. + Copyright (C) 1997-2002, 2003 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/libpthread/linuxthreads/sysdeps/pthread/bits/pthreadtypes.h b/libpthread/linuxthreads/sysdeps/pthread/bits/pthreadtypes.h index db4c3790c..faec63b06 100644 --- a/libpthread/linuxthreads/sysdeps/pthread/bits/pthreadtypes.h +++ b/libpthread/linuxthreads/sysdeps/pthread/bits/pthreadtypes.h @@ -25,8 +25,9 @@ /* Fast locks (not abstract because mutexes and conditions aren't abstract). */ struct _pthread_fastlock { - long int __status; /* "Free" or "taken" or head of waiting list */ - int __spinlock; /* For compare-and-swap emulation */ + long int __status; /* "Free" or "taken" or head of waiting list */ + int __spinlock; /* Used by compare_and_swap emulation. Also, + adaptive SMP lock stores spin count here. */ }; #ifndef _PTHREAD_DESCR_DEFINED @@ -37,7 +38,7 @@ typedef struct _pthread_descr_struct *_pthread_descr; /* Attributes for threads. */ -typedef struct +typedef struct __pthread_attr_s { int __detachstate; int __schedpolicy; @@ -93,7 +94,7 @@ typedef struct typedef int pthread_once_t; -#ifdef __USE_UNIX98 +#if defined __USE_UNIX98 || defined __USE_XOPEN2K /* Read-write locks. */ typedef struct _pthread_rwlock_t { @@ -115,6 +116,25 @@ typedef struct } pthread_rwlockattr_t; #endif +#ifdef __USE_XOPEN2K +/* POSIX spinlock data type. */ +typedef volatile int pthread_spinlock_t; + +/* POSIX barrier. */ +typedef struct { + struct _pthread_fastlock __ba_lock; /* Lock to guarantee mutual exclusion */ + int __ba_required; /* Threads needed for completion */ + int __ba_present; /* Threads waiting */ + _pthread_descr __ba_waiting; /* Queue of waiting threads */ +} pthread_barrier_t; + +/* barrier attribute */ +typedef struct { + int __pshared; +} pthread_barrierattr_t; + +#endif + /* Thread identifiers */ typedef unsigned long int pthread_t; -- cgit v1.2.3