Browse Source

sync misc trivial touchups from glibc

Mike Frysinger 18 years ago
parent
commit
f3a01e0fe2

+ 3 - 2
libpthread/linuxthreads/sysdeps/alpha/pt-machine.h

@@ -1,6 +1,7 @@
 /* Machine-dependent pthreads configuration and inline functions.
 /* Machine-dependent pthreads configuration and inline functions.
    Alpha version.
    Alpha version.
-   Copyright (C) 1996, 1997, 1998, 2000, 2002 Free Software Foundation, Inc.
+   Copyright (C) 1996, 1997, 1998, 2000, 2002, 2003
+   Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    This file is part of the GNU C Library.
    Contributed by Richard Henderson <rth@tamu.edu>.
    Contributed by Richard Henderson <rth@tamu.edu>.
 
 
@@ -23,7 +24,7 @@
 #define _PT_MACHINE_H   1
 #define _PT_MACHINE_H   1
 
 
 #ifndef PT_EI
 #ifndef PT_EI
-# define PT_EI extern inline
+# define PT_EI extern inline __attribute__ ((always_inline))
 #endif
 #endif
 
 
 #ifdef __linux__
 #ifdef __linux__

+ 2 - 2
libpthread/linuxthreads/sysdeps/cris/pt-machine.h

@@ -1,6 +1,6 @@
 /* Machine-dependent pthreads configuration and inline functions.
 /* Machine-dependent pthreads configuration and inline functions.
    CRIS version.
    CRIS version.
-   Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+   Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    This file is part of the GNU C Library.
 
 
    The GNU C Library is free software; you can redistribute it and/or
    The GNU C Library is free software; you can redistribute it and/or
@@ -22,7 +22,7 @@
 #define _PT_MACHINE_H   1
 #define _PT_MACHINE_H   1
 
 
 #ifndef PT_EI
 #ifndef PT_EI
-# define PT_EI extern inline
+# define PT_EI extern inline __attribute__ ((always_inline))
 #endif
 #endif
 
 
 extern long int testandset (int *spinlock);
 extern long int testandset (int *spinlock);

+ 2 - 2
libpthread/linuxthreads/sysdeps/i386/pt-machine.h

@@ -1,6 +1,6 @@
 /* Machine-dependent pthreads configuration and inline functions.
 /* Machine-dependent pthreads configuration and inline functions.
    i386 version.
    i386 version.
-   Copyright (C) 1996-2001, 2002 Free Software Foundation, Inc.
+   Copyright (C) 1996-2001, 2002, 2003 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    This file is part of the GNU C Library.
    Contributed by Richard Henderson <rth@tamu.edu>.
    Contributed by Richard Henderson <rth@tamu.edu>.
 
 
@@ -24,7 +24,7 @@
 
 
 #ifndef __ASSEMBLER__
 #ifndef __ASSEMBLER__
 #ifndef PT_EI
 #ifndef PT_EI
-# define PT_EI extern inline
+# define PT_EI extern inline __attribute__ ((always_inline))
 #endif
 #endif
 
 
 extern long int testandset (int *spinlock);
 extern long int testandset (int *spinlock);

+ 3 - 1
libpthread/linuxthreads/sysdeps/i386/tls.h

@@ -1,5 +1,5 @@
 /* Definition for thread-local data handling.  linuxthreads/i386 version.
 /* Definition for thread-local data handling.  linuxthreads/i386 version.
-   Copyright (C) 2002 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    This file is part of the GNU C Library.
 
 
    The GNU C Library is free software; you can redistribute it and/or
    The GNU C Library is free software; you can redistribute it and/or
@@ -23,7 +23,9 @@
 # include <pt-machine.h>
 # include <pt-machine.h>
 
 
 #ifndef __ASSEMBLER__
 #ifndef __ASSEMBLER__
+# include <stdbool.h>
 # include <stddef.h>
 # include <stddef.h>
+# include <stdint.h>
 
 
 /* Type for the dtv.  */
 /* Type for the dtv.  */
 typedef union dtv
 typedef union dtv

+ 2 - 2
libpthread/linuxthreads/sysdeps/m68k/pt-machine.h

@@ -1,6 +1,6 @@
 /* Machine-dependent pthreads configuration and inline functions.
 /* Machine-dependent pthreads configuration and inline functions.
    m68k version.
    m68k version.
-   Copyright (C) 1996, 1998, 2000, 2002 Free Software Foundation, Inc.
+   Copyright (C) 1996, 1998, 2000, 2002, 2003 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    This file is part of the GNU C Library.
    Contributed by Richard Henderson <rth@tamu.edu>.
    Contributed by Richard Henderson <rth@tamu.edu>.
 
 
@@ -23,7 +23,7 @@
 #define _PT_MACHINE_H   1
 #define _PT_MACHINE_H   1
 
 
 #ifndef PT_EI
 #ifndef PT_EI
-# define PT_EI extern inline
+# define PT_EI extern inline __attribute__ ((always_inline))
 #endif
 #endif
 
 
 extern long int testandset (int *spinlock);
 extern long int testandset (int *spinlock);

+ 3 - 2
libpthread/linuxthreads/sysdeps/mips/pt-machine.h

@@ -1,6 +1,7 @@
 /* Machine-dependent pthreads configuration and inline functions.
 /* Machine-dependent pthreads configuration and inline functions.
 
 
-   Copyright (C) 1996, 1997, 1998, 2000, 2002 Free Software Foundation, Inc.
+   Copyright (C) 1996, 1997, 1998, 2000, 2002, 2003, 2004
+   Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    This file is part of the GNU C Library.
    Contributed by Ralf Baechle <ralf@gnu.org>.
    Contributed by Ralf Baechle <ralf@gnu.org>.
    Based on the Alpha version by Richard Henderson <rth@tamu.edu>.
    Based on the Alpha version by Richard Henderson <rth@tamu.edu>.
@@ -55,7 +56,7 @@ _test_and_set (int *p, int v) __THROW
 
 
 
 
 #ifndef PT_EI
 #ifndef PT_EI
-# define PT_EI extern inline
+# define PT_EI extern inline __attribute__ ((always_inline))
 #endif
 #endif
 
 
 extern long int testandset (int *spinlock);
 extern long int testandset (int *spinlock);

+ 2 - 1
libpthread/linuxthreads/sysdeps/pthread/bits/libc-lock.h

@@ -1,5 +1,6 @@
 /* libc-internal interface for mutex locks.  LinuxThreads version.
 /* 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.
    This file is part of the GNU C Library.
 
 
    The GNU C Library is free software; you can redistribute it and/or
    The GNU C Library is free software; you can redistribute it and/or

+ 1 - 1
libpthread/linuxthreads/sysdeps/pthread/bits/libc-tsd.h

@@ -1,5 +1,5 @@
 /* libc-internal interface for thread-specific data.  LinuxThreads version.
 /* 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.
    This file is part of the GNU C Library.
 
 
    The GNU C Library is free software; you can redistribute it and/or
    The GNU C Library is free software; you can redistribute it and/or

+ 24 - 4
libpthread/linuxthreads/sysdeps/pthread/bits/pthreadtypes.h

@@ -25,8 +25,9 @@
 /* Fast locks (not abstract because mutexes and conditions aren't abstract). */
 /* Fast locks (not abstract because mutexes and conditions aren't abstract). */
 struct _pthread_fastlock
 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
 #ifndef _PTHREAD_DESCR_DEFINED
@@ -37,7 +38,7 @@ typedef struct _pthread_descr_struct *_pthread_descr;
 
 
 
 
 /* Attributes for threads.  */
 /* Attributes for threads.  */
-typedef struct
+typedef struct __pthread_attr_s
 {
 {
   int __detachstate;
   int __detachstate;
   int __schedpolicy;
   int __schedpolicy;
@@ -93,7 +94,7 @@ typedef struct
 typedef int pthread_once_t;
 typedef int pthread_once_t;
 
 
 
 
-#ifdef __USE_UNIX98
+#if defined __USE_UNIX98 || defined __USE_XOPEN2K
 /* Read-write locks.  */
 /* Read-write locks.  */
 typedef struct _pthread_rwlock_t
 typedef struct _pthread_rwlock_t
 {
 {
@@ -115,6 +116,25 @@ typedef struct
 } pthread_rwlockattr_t;
 } pthread_rwlockattr_t;
 #endif
 #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 */
 /* Thread identifiers */
 typedef unsigned long int pthread_t;
 typedef unsigned long int pthread_t;

+ 19 - 15
libpthread/linuxthreads/sysdeps/pthread/pthread.h

@@ -46,7 +46,7 @@ __BEGIN_DECLS
 
 
 #define PTHREAD_COND_INITIALIZER {__LOCK_INITIALIZER, 0}
 #define PTHREAD_COND_INITIALIZER {__LOCK_INITIALIZER, 0}
 
 
-#ifdef __USE_UNIX98
+#if defined __USE_UNIX98 || defined __USE_XOPEN2K
 # define PTHREAD_RWLOCK_INITIALIZER \
 # define PTHREAD_RWLOCK_INITIALIZER \
   { __LOCK_INITIALIZER, 0, NULL, NULL, NULL,				      \
   { __LOCK_INITIALIZER, 0, NULL, NULL, NULL,				      \
     PTHREAD_RWLOCK_DEFAULT_NP, PTHREAD_PROCESS_PRIVATE }
     PTHREAD_RWLOCK_DEFAULT_NP, PTHREAD_PROCESS_PRIVATE }
@@ -110,7 +110,7 @@ enum
 #define PTHREAD_PROCESS_SHARED	PTHREAD_PROCESS_SHARED
 #define PTHREAD_PROCESS_SHARED	PTHREAD_PROCESS_SHARED
 };
 };
 
 
-#ifdef __USE_UNIX98
+#if defined __USE_UNIX98 || defined __USE_XOPEN2K
 enum
 enum
 {
 {
   PTHREAD_RWLOCK_PREFER_READER_NP,
   PTHREAD_RWLOCK_PREFER_READER_NP,
@@ -175,13 +175,12 @@ extern pthread_t pthread_self (void) __THROW;
 extern int pthread_equal (pthread_t __thread1, pthread_t __thread2) __THROW;
 extern int pthread_equal (pthread_t __thread1, pthread_t __thread2) __THROW;
 
 
 /* Terminate calling thread.  */
 /* Terminate calling thread.  */
-extern void pthread_exit (void *__retval)
-     __THROW __attribute__ ((__noreturn__));
+extern void pthread_exit (void *__retval) __attribute__ ((__noreturn__));
 
 
 /* Make calling thread wait for termination of the thread TH.  The
 /* Make calling thread wait for termination of the thread TH.  The
    exit status of the thread is stored in *THREAD_RETURN, if THREAD_RETURN
    exit status of the thread is stored in *THREAD_RETURN, if THREAD_RETURN
    is not NULL.  */
    is not NULL.  */
-extern int pthread_join (pthread_t __th, void **__thread_return) __THROW;
+extern int pthread_join (pthread_t __th, void **__thread_return);
 
 
 /* Indicate that the thread TH is never to be joined with PTHREAD_JOIN.
 /* Indicate that the thread TH is never to be joined with PTHREAD_JOIN.
    The resources of TH will therefore be freed immediately when it
    The resources of TH will therefore be freed immediately when it
@@ -300,7 +299,9 @@ extern int pthread_attr_getstacksize (__const pthread_attr_t *__restrict
 /* Not yet implemented in uClibc! */
 /* Not yet implemented in uClibc! */
 
 
 #ifdef __USE_GNU
 #ifdef __USE_GNU
-/* Get thread attributes corresponding to the already running thread TH.  */
+/* Initialize thread attribute *ATTR with attributes corresponding to the
+   already running thread TH.  It shall be called on unitialized ATTR
+   and destroyed with pthread_attr_destroy when no longer needed.  */
 extern int pthread_getattr_np (pthread_t __th, pthread_attr_t *__attr) __THROW;
 extern int pthread_getattr_np (pthread_t __th, pthread_attr_t *__attr) __THROW;
 #endif
 #endif
 #endif
 #endif
@@ -418,7 +419,7 @@ extern int pthread_cond_broadcast (pthread_cond_t *__cond) __THROW;
 /* Wait for condition variable COND to be signaled or broadcast.
 /* Wait for condition variable COND to be signaled or broadcast.
    MUTEX is assumed to be locked before.  */
    MUTEX is assumed to be locked before.  */
 extern int pthread_cond_wait (pthread_cond_t *__restrict __cond,
 extern int pthread_cond_wait (pthread_cond_t *__restrict __cond,
-			      pthread_mutex_t *__restrict __mutex) __THROW;
+			      pthread_mutex_t *__restrict __mutex);
 
 
 /* Wait for condition variable COND to be signaled or broadcast until
 /* Wait for condition variable COND to be signaled or broadcast until
    ABSTIME.  MUTEX is assumed to be locked before.  ABSTIME is an
    ABSTIME.  MUTEX is assumed to be locked before.  ABSTIME is an
@@ -427,7 +428,7 @@ extern int pthread_cond_wait (pthread_cond_t *__restrict __cond,
 extern int pthread_cond_timedwait (pthread_cond_t *__restrict __cond,
 extern int pthread_cond_timedwait (pthread_cond_t *__restrict __cond,
 				   pthread_mutex_t *__restrict __mutex,
 				   pthread_mutex_t *__restrict __mutex,
 				   __const struct timespec *__restrict
 				   __const struct timespec *__restrict
-				   __abstime) __THROW;
+				   __abstime);
 
 
 /* Functions for handling condition variable attributes.  */
 /* Functions for handling condition variable attributes.  */
 
 
@@ -447,7 +448,7 @@ extern int pthread_condattr_setpshared (pthread_condattr_t *__attr,
 					int __pshared) __THROW;
 					int __pshared) __THROW;
 
 
 
 
-#ifdef __USE_UNIX98
+#if defined __USE_UNIX98 || defined __USE_XOPEN2K
 /* Functions for handling read-write locks.  */
 /* Functions for handling read-write locks.  */
 
 
 /* Initialize read-write lock RWLOCK using attributes ATTR, or use
 /* Initialize read-write lock RWLOCK using attributes ATTR, or use
@@ -593,28 +594,31 @@ extern void *pthread_getspecific (pthread_key_t __key) __THROW;
 /* Guarantee that the initialization function INIT_ROUTINE will be called
 /* Guarantee that the initialization function INIT_ROUTINE will be called
    only once, even if pthread_once is executed several times with the
    only once, even if pthread_once is executed several times with the
    same ONCE_CONTROL argument. ONCE_CONTROL must point to a static or
    same ONCE_CONTROL argument. ONCE_CONTROL must point to a static or
-   extern variable initialized to PTHREAD_ONCE_INIT.  */
+   extern variable initialized to PTHREAD_ONCE_INIT.
+
+   The initialization functions might throw exception which is why
+   this function is not marked with __THROW.  */
 extern int pthread_once (pthread_once_t *__once_control,
 extern int pthread_once (pthread_once_t *__once_control,
-			 void (*__init_routine) (void)) __THROW;
+			 void (*__init_routine) (void));
 
 
 
 
 /* Functions for handling cancellation.  */
 /* Functions for handling cancellation.  */
 
 
 /* Set cancelability state of current thread to STATE, returning old
 /* Set cancelability state of current thread to STATE, returning old
    state in *OLDSTATE if OLDSTATE is not NULL.  */
    state in *OLDSTATE if OLDSTATE is not NULL.  */
-extern int pthread_setcancelstate (int __state, int *__oldstate) __THROW;
+extern int pthread_setcancelstate (int __state, int *__oldstate);
 
 
 /* Set cancellation state of current thread to TYPE, returning the old
 /* Set cancellation state of current thread to TYPE, returning the old
    type in *OLDTYPE if OLDTYPE is not NULL.  */
    type in *OLDTYPE if OLDTYPE is not NULL.  */
-extern int pthread_setcanceltype (int __type, int *__oldtype) __THROW;
+extern int pthread_setcanceltype (int __type, int *__oldtype);
 
 
 /* Cancel THREAD immediately or at the next possibility.  */
 /* Cancel THREAD immediately or at the next possibility.  */
-extern int pthread_cancel (pthread_t __thread_id) __THROW;
+extern int pthread_cancel (pthread_t __cancelthread);
 
 
 /* Test for pending cancellation for the current thread and terminate
 /* Test for pending cancellation for the current thread and terminate
    the thread as per pthread_exit(PTHREAD_CANCELED) if it has been
    the thread as per pthread_exit(PTHREAD_CANCELED) if it has been
    cancelled.  */
    cancelled.  */
-extern void pthread_testcancel (void) __THROW;
+extern void pthread_testcancel (void);
 
 
 
 
 /* Install a cleanup handler: ROUTINE will be called with arguments ARG
 /* Install a cleanup handler: ROUTINE will be called with arguments ARG

+ 2 - 2
libpthread/linuxthreads/sysdeps/sh/pt-machine.h

@@ -1,6 +1,6 @@
 /* Machine-dependent pthreads configuration and inline functions.
 /* Machine-dependent pthreads configuration and inline functions.
    SuperH version.
    SuperH version.
-   Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    This file is part of the GNU C Library.
    Contributed by Niibe Yutaka <gniibe@m17n.org>.
    Contributed by Niibe Yutaka <gniibe@m17n.org>.
 
 
@@ -24,7 +24,7 @@
 
 
 #ifndef __ASSEMBLER__
 #ifndef __ASSEMBLER__
 #ifndef PT_EI
 #ifndef PT_EI
-# define PT_EI extern inline
+# define PT_EI extern inline __attribute__ ((always_inline))
 #endif
 #endif
 
 
 extern long int testandset (int *spinlock);
 extern long int testandset (int *spinlock);

+ 6 - 4
libpthread/linuxthreads/sysdeps/sh/tls.h

@@ -1,5 +1,5 @@
 /* Definition for thread-local data handling.  linuxthreads/SH version.
 /* Definition for thread-local data handling.  linuxthreads/SH version.
-   Copyright (C) 2002 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    This file is part of the GNU C Library.
 
 
    The GNU C Library is free software; you can redistribute it and/or
    The GNU C Library is free software; you can redistribute it and/or
@@ -20,10 +20,12 @@
 #ifndef _TLS_H
 #ifndef _TLS_H
 #define _TLS_H
 #define _TLS_H
 
 
-#ifndef __ASSEMBLER__
-#include <stddef.h>
+# include <pt-machine.h>
 
 
-#include <pt-machine.h>
+#ifndef __ASSEMBLER__
+# include <stdbool.h>
+# include <stddef.h>
+# include <stdint.h>
 
 
 /* Type for the dtv.  */
 /* Type for the dtv.  */
 typedef union dtv
 typedef union dtv