Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/gnu Regenerated.



details:   https://anonhg.NetBSD.org/src/rev/03e02457c6af
branches:  trunk
changeset: 551188:03e02457c6af
user:      matt <matt%NetBSD.org@localhost>
date:      Sun Aug 31 19:45:25 2003 +0000

description:
Regenerated.

diffstat:

 gnu/lib/libstdc++-v3/arch/alpha/c++config.h    |   10 +-
 gnu/lib/libstdc++-v3/arch/alpha/config.h       |    8 +-
 gnu/lib/libstdc++-v3/arch/alpha/gthr-default.h |  396 +++++++++++++++++++++---
 gnu/usr.bin/gcc3/arch/alpha/configargs.h       |    4 +-
 gnu/usr.bin/gcc3/libiberty/defs.mk             |    2 +-
 5 files changed, 351 insertions(+), 69 deletions(-)

diffs (truncated from 659 to 300 lines):

diff -r 9b4d73b75ea9 -r 03e02457c6af gnu/lib/libstdc++-v3/arch/alpha/c++config.h
--- a/gnu/lib/libstdc++-v3/arch/alpha/c++config.h       Sun Aug 31 16:53:03 2003 +0000
+++ b/gnu/lib/libstdc++-v3/arch/alpha/c++config.h       Sun Aug 31 19:45:25 2003 +0000
@@ -1,5 +1,5 @@
 /* This file is automatically generated.  DO NOT EDIT! */
-/* Generated from:     NetBSD: mknative-gcc,v 1.1 2003/07/25 16:26:53 mrg Exp  */
+/* Generated from:     NetBSD: mknative-gcc,v 1.7 2003/08/22 00:24:46 mrg Exp  */
 
 // Predefined symbols and macros -*- C++ -*-
 
@@ -38,7 +38,7 @@
 #include <bits/os_defines.h>
 
 // The current version of the C++ library in compressed ISO date format.
-#define __GLIBCPP__ 20030720
+#define __GLIBCPP__ 20030804
 
 // This is necessary until GCC supports separate template compilation.
 #define _GLIBCPP_NO_TEMPLATE_EXPORT 1
@@ -108,10 +108,10 @@
 #define _GLIBCPP_HAVE_MMAP 1
 
 // Define if GCC supports weak symbols.
-/* #undef _GLIBCPP_SUPPORTS_WEAK */
+#define _GLIBCPP_SUPPORTS_WEAK __GXX_WEAK__
 
 // Include I/O support for 'long long' and 'unsigned long long'.
-/* #undef _GLIBCPP_USE_LONG_LONG */
+#define _GLIBCPP_USE_LONG_LONG 1
 
 // Define if C99 features such as lldiv_t, llabs, lldiv should be exposed.
 /* #undef _GLIBCPP_USE_C99 */
@@ -140,7 +140,7 @@
 #endif
 
 // Define if gthr-default.h exists (meaning that threading support is enabled).
-/* #undef _GLIBCPP_HAVE_GTHR_DEFAULT */
+#define _GLIBCPP_HAVE_GTHR_DEFAULT 1
 
 // Define if drand48 exists.
 /* #undef _GLIBCPP_HAVE_DRAND48 */
diff -r 9b4d73b75ea9 -r 03e02457c6af gnu/lib/libstdc++-v3/arch/alpha/config.h
--- a/gnu/lib/libstdc++-v3/arch/alpha/config.h  Sun Aug 31 16:53:03 2003 +0000
+++ b/gnu/lib/libstdc++-v3/arch/alpha/config.h  Sun Aug 31 19:45:25 2003 +0000
@@ -1,5 +1,5 @@
 /* This file is automatically generated.  DO NOT EDIT! */
-/* Generated from:     NetBSD: mknative-gcc,v 1.6 2003/08/01 02:44:56 mrg Exp  */
+/* Generated from:     NetBSD: mknative-gcc,v 1.7 2003/08/22 00:24:46 mrg Exp  */
 
 /* config.h.  Generated automatically by configure.  */
 /* config.h.in.  Generated automatically from configure.in by autoheader.  */
@@ -8,10 +8,10 @@
 #define HAVE_MMAP 1
 
 // Define if GCC supports weak symbols.
-/* #undef _GLIBCPP_SUPPORTS_WEAK */
+#define _GLIBCPP_SUPPORTS_WEAK __GXX_WEAK__
 
 // Include I/O support for 'long long' and 'unsigned long long'.
-/* #undef _GLIBCPP_USE_LONG_LONG */
+#define _GLIBCPP_USE_LONG_LONG 1
 
 // Define if C99 features such as lldiv_t, llabs, lldiv should be exposed.
 /* #undef _GLIBCPP_USE_C99 */
@@ -40,7 +40,7 @@
 #endif
 
 // Define if gthr-default.h exists (meaning that threading support is enabled).
-/* #undef HAVE_GTHR_DEFAULT */
+#define HAVE_GTHR_DEFAULT 1
 
 // Define if drand48 exists.
 /* #undef HAVE_DRAND48 */
diff -r 9b4d73b75ea9 -r 03e02457c6af gnu/lib/libstdc++-v3/arch/alpha/gthr-default.h
--- a/gnu/lib/libstdc++-v3/arch/alpha/gthr-default.h    Sun Aug 31 16:53:03 2003 +0000
+++ b/gnu/lib/libstdc++-v3/arch/alpha/gthr-default.h    Sun Aug 31 19:45:25 2003 +0000
@@ -1,9 +1,9 @@
 /* This file is automatically generated.  DO NOT EDIT! */
-/* Generated from:     NetBSD: mknative-gcc,v 1.1 2003/07/25 16:26:53 mrg Exp  */
+/* Generated from:     NetBSD: mknative-gcc,v 1.7 2003/08/22 00:24:46 mrg Exp  */
 
 /* Threads compatibility routines for libgcc2 and libobjc.  */
 /* Compile this one with gcc.  */
-/* Copyright (C) 1997, 1999, 2000 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 1999, 2000, 2001 Free Software Foundation, Inc.
 
 This file is part of GCC.
 
@@ -29,22 +29,93 @@
    This exception does not however invalidate any other reasons why
    the executable file might be covered by the GNU General Public License.  */
 
-#ifndef _GLIBCPP_GCC_GTHR_SINGLE_H
-#define _GLIBCPP_GCC_GTHR_SINGLE_H
+#ifndef _GLIBCPP_GCC_GTHR_POSIX_H
+#define _GLIBCPP_GCC_GTHR_POSIX_H
+
+/* POSIX threads specific definitions.
+   Easy, since the interface is just one-to-one mapping.  */
+
+#define __GTHREADS 1
+
+#include <pthread.h>
+#include <unistd.h>
+
+typedef pthread_key_t __gthread_key_t;
+typedef pthread_once_t __gthread_once_t;
+typedef pthread_mutex_t __gthread_mutex_t;
 
-/* Just provide compatibility for mutex handling.  */
+#define __GTHREAD_MUTEX_INIT PTHREAD_MUTEX_INITIALIZER
+#define __GTHREAD_ONCE_INIT PTHREAD_ONCE_INIT
+
+#if _GLIBCPP_SUPPORTS_WEAK && _GLIBCPP_GTHREAD_USE_WEAK
 
-typedef int __gthread_mutex_t;
+#pragma weak pthread_once
+#pragma weak pthread_key_create
+#pragma weak pthread_key_delete
+#pragma weak pthread_getspecific
+#pragma weak pthread_setspecific
+#pragma weak pthread_create
+
+#pragma weak pthread_mutex_lock
+#pragma weak pthread_mutex_trylock
+#pragma weak pthread_mutex_unlock
 
-#define __GTHREAD_MUTEX_INIT 0
+#ifdef _LIBOBJC
+/* Objective-C.  */
+#pragma weak pthread_cond_broadcast
+#pragma weak pthread_cond_destroy
+#pragma weak pthread_cond_init
+#pragma weak pthread_cond_signal
+#pragma weak pthread_cond_wait
+#pragma weak pthread_exit
+#pragma weak pthread_mutex_init
+#pragma weak pthread_mutex_destroy
+#pragma weak pthread_self
+/* These really should be protected by _POSIX_PRIORITY_SCHEDULING, but
+   we use them inside a _POSIX_THREAD_PRIORITY_SCHEDULING block.  */
+#ifdef _POSIX_THREAD_PRIORITY_SCHEDULING
+#pragma weak sched_get_priority_max
+#pragma weak sched_get_priority_min
+#endif /* _POSIX_THREAD_PRIORITY_SCHEDULING */
+#pragma weak sched_yield
+#pragma weak pthread_attr_destroy
+#pragma weak pthread_attr_init
+#pragma weak pthread_attr_setdetachstate
+#ifdef _POSIX_THREAD_PRIORITY_SCHEDULING
+#pragma weak pthread_getschedparam
+#pragma weak pthread_setschedparam
+#endif /* _POSIX_THREAD_PRIORITY_SCHEDULING */
+#endif /* _LIBOBJC */
 
-#ifdef __cplusplus
-#define _GLIBCPP_UNUSED(x)
-#else
-#define _GLIBCPP_UNUSED(x) x __attribute__((unused))
+static inline int
+__gthread_active_p (void)
+{
+  static void *const __gthread_active_ptr = (void *) &pthread_create;
+  return __gthread_active_ptr != 0;
+}
+
+#else /* not _GLIBCPP_SUPPORTS_WEAK */
+
+static inline int
+__gthread_active_p (void)
+{
+  return 1;
+}
+
+#endif /* _GLIBCPP_SUPPORTS_WEAK */
+
+#ifdef _LIBOBJC
+
+/* This is the config.h file in libobjc/ */
+#include <config.h>
+
+#ifdef HAVE_SCHED_H
+# include <sched.h>
 #endif
 
-#ifdef _LIBOBJC
+/* Key structure for maintaining thread specific storage */
+static pthread_key_t _objc_thread_storage;
+static pthread_attr_t _objc_thread_attribs;
 
 /* Thread local storage for a single thread */
 static void *thread_local_storage = NULL;
@@ -55,7 +126,21 @@
 static inline int
 __gthread_objc_init_thread_system (void)
 {
-  /* No thread support available */
+  if (__gthread_active_p ())
+    {
+      /* Initialize the thread storage key */
+      if (pthread_key_create (&_objc_thread_storage, NULL) == 0)
+       {
+         /* The normal default detach state for threads is
+          * PTHREAD_CREATE_JOINABLE which causes threads to not die
+          * when you think they should.  */
+         if (pthread_attr_init (&_objc_thread_attribs) == 0
+             && pthread_attr_setdetachstate (&_objc_thread_attribs,
+                                             PTHREAD_CREATE_DETACHED) == 0)
+           return 0;
+       }
+    }
+
   return -1;
 }
 
@@ -63,7 +148,11 @@
 static inline int
 __gthread_objc_close_thread_system (void)
 {
-  /* No thread support available */
+  if (__gthread_active_p ()
+      && pthread_key_delete (_objc_thread_storage) == 0
+      && pthread_attr_destroy (&_objc_thread_attribs) == 0)
+    return 0;
+
   return -1;
 }
 
@@ -71,41 +160,100 @@
 
 /* Create a new thread of execution.  */
 static inline objc_thread_t
-__gthread_objc_thread_detach (void (* func)(void *), void * _GLIBCPP_UNUSED(arg))
+__gthread_objc_thread_detach (void (*func)(void *), void *arg)
 {
-  /* No thread support available */
-  return NULL;
+  objc_thread_t thread_id;
+  pthread_t new_thread_handle;
+
+  if (!__gthread_active_p ())
+    return NULL;
+
+  if (!(pthread_create (&new_thread_handle, NULL, (void *) func, arg)))
+    thread_id = (objc_thread_t) new_thread_handle;
+  else
+    thread_id = NULL;
+
+  return thread_id;
 }
 
 /* Set the current thread's priority.  */
 static inline int
-__gthread_objc_thread_set_priority (int _GLIBCPP_UNUSED(priority))
+__gthread_objc_thread_set_priority (int priority)
 {
-  /* No thread support available */
-  return -1;
+  if (!__gthread_active_p ())
+    return -1;
+  else
+    {
+#ifdef _POSIX_THREAD_PRIORITY_SCHEDULING
+      pthread_t thread_id = pthread_self ();
+      int policy;
+      struct sched_param params;
+      int priority_min, priority_max;
+
+      if (pthread_getschedparam (thread_id, &policy, &params) == 0)
+       {
+         if ((priority_max = sched_get_priority_max (policy)) == -1)
+           return -1;
+
+         if ((priority_min = sched_get_priority_min (policy)) == -1)
+           return -1;
+
+         if (priority > priority_max)
+           priority = priority_max;
+         else if (priority < priority_min)
+           priority = priority_min;
+         params.sched_priority = priority;
+
+         /*
+          * The solaris 7 and several other man pages incorrectly state that
+          * this should be a pointer to policy but pthread.h is universally
+          * at odds with this.
+          */
+         if (pthread_setschedparam (thread_id, policy, &params) == 0)
+           return 0;
+       }
+#endif /* _POSIX_THREAD_PRIORITY_SCHEDULING */
+      return -1;
+    }
 }
 
 /* Return the current thread's priority.  */
 static inline int
 __gthread_objc_thread_get_priority (void)
 {
-  return OBJC_THREAD_INTERACTIVE_PRIORITY;



Home | Main Index | Thread Index | Old Index