aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRanjit Mathew <rmathew@hotmail.com>2005-01-17 14:17:41 +0000
committerRanjit Mathew <rmathew@gcc.gnu.org>2005-01-17 14:17:41 +0000
commit658acbb2879a50a76ef85954d942788053aeb1a1 (patch)
tree6237706efe80abda4c5d24f91ae1f6b303b5345f
parentac317859d409434b0f5ef8ec89a7abcacb10bd3e (diff)
downloadgcc-658acbb2879a50a76ef85954d942788053aeb1a1.zip
gcc-658acbb2879a50a76ef85954d942788053aeb1a1.tar.gz
gcc-658acbb2879a50a76ef85954d942788053aeb1a1.tar.bz2
gthr-posix.h (__gthread_active_p): Use pthread_cancel instead of pthread_create to find out if threads are enabled.
* gthr-posix.h (__gthread_active_p): Use pthread_cancel instead of pthread_create to find out if threads are enabled. * gthr-posix95.h (__gthread_active_p): Likewise. From-SVN: r93762
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/gthr-posix.h5
-rw-r--r--gcc/gthr-posix95.h5
3 files changed, 12 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 0076ff5..47d6a63 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2005-01-17 Ranjit Mathew <rmathew@hotmail.com>
+
+ * gthr-posix.h (__gthread_active_p): Use pthread_cancel instead
+ of pthread_create to find out if threads are enabled.
+ * gthr-posix95.h (__gthread_active_p): Likewise.
+
2005-01-17 Ira Rosen <irar@il.ibm.com>
* fortran/f95-lang.c (gfc_init_builtin_functions): Call
diff --git a/gcc/gthr-posix.h b/gcc/gthr-posix.h
index 7cab614..9b56b5a 100644
--- a/gcc/gthr-posix.h
+++ b/gcc/gthr-posix.h
@@ -1,6 +1,6 @@
/* Threads compatibility routines for libgcc2 and libobjc. */
/* Compile this one with gcc. */
-/* Copyright (C) 1997, 1999, 2000, 2001, 2002, 2003, 2004
+/* 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
@@ -106,7 +107,7 @@ static inline int
__gthread_active_p (void)
{
static void *const __gthread_active_ptr
- = __extension__ (void *) &pthread_create;
+ = __extension__ (void *) &pthread_cancel;
return __gthread_active_ptr != 0;
}
diff --git a/gcc/gthr-posix95.h b/gcc/gthr-posix95.h
index f10317d..b0bd132 100644
--- a/gcc/gthr-posix95.h
+++ b/gcc/gthr-posix95.h
@@ -1,6 +1,6 @@
/* Threads compatibility routines for libgcc2 and libobjc. */
/* Compile this one with gcc. */
-/* Copyright (C) 2004 Free Software Foundation, Inc.
+/* Copyright (C) 2004, 2005 Free Software Foundation, Inc.
This file is part of GCC.
@@ -64,6 +64,7 @@ typedef struct {
#pragma weak pthread_getspecific
#pragma weak pthread_setspecific
#pragma weak pthread_create
+#pragma weak pthread_cancel
#pragma weak pthread_self
#pragma weak pthread_mutex_lock
@@ -105,7 +106,7 @@ static inline int
__gthread_active_p (void)
{
static void *const __gthread_active_ptr
- = __extension__ (void *) &pthread_create;
+ = __extension__ (void *) &pthread_cancel;
return __gthread_active_ptr != 0;
}