This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

PATCH: Support pthread on IRIX 6 (take 2)


This is an update for

http://gcc.gnu.org/ml/gcc-patches/2001-06/msg00824.html


H.J.
----
2001-07-20  H.J. Lu <hjl@gnu.org>

	* doc/tm.texi (PTHREAD_ACTIVE_FUNCTION): Document it.

	* gthr-posix.h (PTHREAD_ACTIVE_FUNCTION): Defined as
	pthread_create if not defined.
	(__gthread_active_ptr): Initiliazed with
	PTHREAD_ACTIVE_FUNCTION.

	* config/mips/iris6.h (PTHREAD_ACTIVE_FUNCTION): Defined as
	pthread_once. IRIX 6.5 has pthread_create in libc.so.

--- gcc/config/mips/iris6.h.pthread	Fri Jul 20 09:51:48 2001
+++ gcc/config/mips/iris6.h	Fri Jul 20 09:52:48 2001
@@ -568,3 +568,5 @@ do {									 \
 %{shared:-hidden_symbol __do_global_ctors,__do_global_dtors,__EH_FRAME_BEGIN__,__frame_dummy} \
 -_SYSTYPE_SVR4 -woff 131 \
 %{mabi=32: -32}%{mabi=n32: -n32}%{mabi=64: -64}%{!mabi*: -n32}"
+
+#define PTHREAD_ACTIVE_FUNCTION pthread_once
--- gcc/doc/tm.texi.pthread	Fri Jul 20 09:18:03 2001
+++ gcc/doc/tm.texi	Fri Jul 20 10:02:13 2001
@@ -8694,4 +8694,10 @@ ignored.  This function should return th
 built-in function.
 @end deftypefn
 
+@findex PTHREAD_ACTIVE_FUNCTION
+@item PTHREAD_ACTIVE_FUNCTION
+@code{PTHREAD_ACTIVE_FUNCTION} defines the pthread library function
+used to detect if a program is using the pthread library. The default
+one is @code{pthread_create}.
+
 @end table
--- gcc/gthr-posix.h.pthread	Fri Jul 20 09:17:13 2001
+++ gcc/gthr-posix.h	Fri Jul 20 09:51:03 2001
@@ -77,7 +77,11 @@ typedef pthread_mutex_t __gthread_mutex_
 #pragma weak pthread_setschedparam
 #endif
 
-static void *__gthread_active_ptr = (void *) &pthread_create;
+#ifndef PTHREAD_ACTIVE_FUNCTION
+#define PTHREAD_ACTIVE_FUNCTION pthread_create
+#endif
+
+static void *__gthread_active_ptr = (void *) &PTHREAD_ACTIVE_FUNCTION;
 
 static inline int
 __gthread_active_p (void)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]