OSDN Git Service

* timevar.def (TV_SCEV_CONST): New timevar.
[pf3gnuchains/gcc-fork.git] / gcc / gthr-posix.h
index 940c721..9b56b5a 100644 (file)
@@ -1,6 +1,6 @@
 /* Threads compatibility routines for libgcc2 and libobjc.  */
 /* Compile this one with gcc.  */
-/* Copyright (C) 1997, 1999, 2000, 2001, 2002, 2003
+/* Copyright (C) 1997, 1999, 2000, 2001, 2002, 2003, 2004, 2005
    Free Software Foundation, Inc.
 
 This file is part of GCC.
@@ -66,6 +66,7 @@ typedef pthread_mutex_t __gthread_recursive_mutex_t;
 #pragma weak pthread_getspecific
 #pragma weak pthread_setspecific
 #pragma weak pthread_create
+#pragma weak pthread_cancel
 
 #pragma weak pthread_mutex_lock
 #pragma weak pthread_mutex_trylock
@@ -105,7 +106,8 @@ typedef pthread_mutex_t __gthread_recursive_mutex_t;
 static inline int
 __gthread_active_p (void)
 {
-  static void *const __gthread_active_ptr = (void *) &pthread_create;
+  static void *const __gthread_active_ptr 
+    = __extension__ (void *) &pthread_cancel;
   return __gthread_active_ptr != 0;
 }
 
@@ -143,7 +145,7 @@ __gthread_objc_init_thread_system (void)
 {
   if (__gthread_active_p ())
     {
-      /* Initialize the thread storage key */
+      /* Initialize the thread storage key */
       if (pthread_key_create (&_objc_thread_storage, NULL) == 0)
        {
          /* The normal default detach state for threads is