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


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

PATCH: Support threads on FreeBSD/i386


With the attached threading configuration patch, I now see:

gmake[1]: Entering directory `[...]/i386-unknown-freebsd4.3/boehm-gc'
Completed 3 tests
Allocated 5694248 collectable objects
Allocated 306 uncollectable objects
Allocated 3750000 atomic objects
Allocated 33000 stubborn objects
Finalized 6615/6615 objects - finalization is probably ok
Total number of bytes allocated is 187508436
Final heap size is 7385088 bytes
Collector appears to work
Completed 172 collections
PASS: gctest

With the attached threading configuration patch and an unposted
~6-line configuration patch in libjava (still being tuned), I now see:

                === libjava Summary ===

# of expected passes            1770
# of unexpected failures        43 [16 of which are gratuitous failures]
# of unexpected successes       2  [& 14 of which were basically duplicates]
# of expected failures          16
# of untested testcases         41

[Until I get a final threading configuration detail sorted out, I must
 use ``gmake 'RUNTESTFLAGS=--target_board unix{-pthread}' check''.]

Requesting permission to apply to mainline.  If my current test
results in libjava are any guide, this gets me to 4th down and inches
of the goal of enabling libjava by default on i386-unknown-freebsd*
against its existing default configuration.  That will get quite a few
more people bootstrapping libjava by default on a non-Linux platform...

Since this configuration patch took so much less time than debugging
the dynamic library issue (see last configuration patch), I won't even
complain that it should be easier to add support for a new plain-jane
pthread platform... ;-)

Notes:

- I have made no attempt to get the advanced threading features
  working yet.  It is my hope that I can incrementally tune as time
  allows and as required.

- About 1 out of 5 times I run `make check', I get some form of a dead
  lock (I am only fairly sure at this point that it is not a live
  lock).  I will investigate where the lock occurs (but debugging
  threads on this platform is a tad difficult at the moment).  Based
  upon a quick check, I think I am using the I386 spin lock support.
  I haven't done anything to investigate in earnest yet.

- MPROTECT_VDB normally works on this platform.  It had to be disabled
  else I saw an expected SIGSEGV and/or SIGBUS early in the test run
  (perhaps at the first collection - not investigated at all yet).

- On this platform, the wrapped pthread_join() sometimes returns (what
  appears to be) a spurious EINTR which caused the test to
  gratuitously fail.  Having looked at system pthread library source
  code, I see how this return code may be generated.  In one path of
  code, pthread_join() just returns the errno setting of the thread
  being joined.  This does not match the POSIX specification or the
  local man pages thus I have taken the liberty to catch this one
  spurious return value properly conditionalized on FREEBSD_THREADS.

- I used SIGUSR1 and SIGUSR2 for this configuration.  Do I need to
  document that somewhere?  (I already have the small patch I need in
  ./libjava/posix-threads.cc due to this particular choice.)

Regards,
Loren

2001-08-20  Loren J. Rittle  <ljrittle@acm.org>

	* configure.in (GC_FREEBSD_THREADS): Define it instead of...
	(FREEBSD_THREADS): ...this to follow the latest macro convention.
	* configure: Rebuilt.

	* dyn_load.c: While basically copying the minimal
	LINUX_THREADS code path, enable pthread support on FreeBSD.
	* gc_dlopen.c: Likewise.
	* misc.c: Likewise.
	* os_dep.c: Likewise.
	* threadlibs.c: Likewise.
	* include/gc.h: Likewise.
	* include/gc_pthread_redirects.h: Likewise.
	* include/private/gc_locks.h: Likewise.
	* include/private/gc_priv.h: Likewise.
	* tests/test.c: Likewise.
	* include/private/gcconfig.h: Likewise.
	(MPROTECT_VDB): Do not define when GC_FREEBSD_THREADS.
	* linux_threads.c: Likewise.
	(WRAP_FUNC(pthread_join)): Fix-up spurious EINTR return from
	REAL_FUNC(pthread_join) in the wrapper.

Index: configure.in
===================================================================
RCS file: /cvs/gcc/egcs/boehm-gc/configure.in,v
retrieving revision 1.31
diff -c -r1.31 configure.in
*** configure.in	2001/08/20 16:40:46	1.31
--- configure.in	2001/08/21 06:12:36
***************
*** 91,97 ****
  	;;
       *-*-freebsd*)
  	AC_MSG_WARN("FreeBSD does not yet fully support threads with Boehm GC.")
! 	AC_DEFINE(FREEBSD_THREADS)
  	INCLUDES="$INCLUDES -pthread"
  	THREADLIBS=-pthread
        	;;
--- 91,97 ----
  	;;
       *-*-freebsd*)
  	AC_MSG_WARN("FreeBSD does not yet fully support threads with Boehm GC.")
! 	AC_DEFINE(GC_FREEBSD_THREADS)
  	INCLUDES="$INCLUDES -pthread"
  	THREADLIBS=-pthread
        	;;
Index: dyn_load.c
===================================================================
RCS file: /cvs/gcc/egcs/boehm-gc/dyn_load.c,v
retrieving revision 1.12
diff -c -r1.12 dyn_load.c
*** dyn_load.c	2001/08/18 01:04:43	1.12
--- dyn_load.c	2001/08/21 06:12:36
***************
*** 33,39 ****
  
  /* BTL: avoid circular redefinition of dlopen if SOLARIS_THREADS defined */
  # if (defined(LINUX_THREADS) || defined(SOLARIS_THREADS) \
!       || defined(HPUX_THREADS) || defined(IRIX_THREADS)) && defined(dlopen) \
       && !defined(GC_USE_LD_WRAP)
      /* To support threads in Solaris, gc.h interposes on dlopen by       */
      /* defining "dlopen" to be "GC_dlopen", which is implemented below.  */
--- 33,40 ----
  
  /* BTL: avoid circular redefinition of dlopen if SOLARIS_THREADS defined */
  # if (defined(LINUX_THREADS) || defined(SOLARIS_THREADS) \
!       || defined(HPUX_THREADS) || defined(IRIX_THREADS) \
!       || defined(FREEBSD_THREADS)) && defined(dlopen) \
       && !defined(GC_USE_LD_WRAP)
      /* To support threads in Solaris, gc.h interposes on dlopen by       */
      /* defining "dlopen" to be "GC_dlopen", which is implemented below.  */
Index: gc_dlopen.c
===================================================================
RCS file: /cvs/gcc/egcs/boehm-gc/gc_dlopen.c,v
retrieving revision 1.2
diff -c -r1.2 gc_dlopen.c
*** gc_dlopen.c	2001/08/17 18:30:45	1.2
--- gc_dlopen.c	2001/08/21 06:12:36
***************
*** 25,31 ****
  #include "private/gc_priv.h"
  
  # if defined(LINUX_THREADS) || defined(SOLARIS_THREADS) \
!      || defined(HPUX_THREADS) || defined(IRIX_THREADS)
  
  # if defined(dlopen) && !defined(GC_USE_LD_WRAP)
      /* To support various threads pkgs, gc.h interposes on dlopen by     */
--- 25,32 ----
  #include "private/gc_priv.h"
  
  # if defined(LINUX_THREADS) || defined(SOLARIS_THREADS) \
!      || defined(HPUX_THREADS) || defined(IRIX_THREADS) \
!      || defined(FREEBSD_THREADS)
  
  # if defined(dlopen) && !defined(GC_USE_LD_WRAP)
      /* To support various threads pkgs, gc.h interposes on dlopen by     */
Index: linux_threads.c
===================================================================
RCS file: /cvs/gcc/egcs/boehm-gc/linux_threads.c,v
retrieving revision 1.13
diff -c -r1.13 linux_threads.c
*** linux_threads.c	2001/08/18 01:04:43	1.13
--- linux_threads.c	2001/08/21 06:12:36
***************
*** 28,34 ****
   */
  /*
   * Linux_threads.c now also includes some code to support HPUX and
!  * OSF1 (Compaq Tru64 Unix, really).  The OSF1 support is not yet
   * functional.  The OSF1 code is based on Eric Benson's
   * patch, though that was originally against hpux_irix_threads.  The code
   * here is completely untested.  With 0.0000001% probability, it might
--- 28,34 ----
   */
  /*
   * Linux_threads.c now also includes some code to support HPUX and
!  * OSF1 (Compaq Tru64 Unix, really) and FreeBSD.  The OSF1 support is not yet
   * functional.  The OSF1 code is based on Eric Benson's
   * patch, though that was originally against hpux_irix_threads.  The code
   * here is completely untested.  With 0.0000001% probability, it might
***************
*** 53,58 ****
--- 53,59 ----
  # if defined(GC_LINUX_THREADS) || defined(LINUX_THREADS) \
       || defined(GC_HPUX_THREADS) || defined(HPUX_THREADS) \
       || defined(GC_OSF1_THREADS) || defined(OSF1_THREADS) \
+      || defined(GC_FREEBSD_THREADS) || defined(FREEBSD_THREADS) \
  
  # include "private/gc_priv.h"
  
***************
*** 458,464 ****
  
  sem_t GC_suspend_ack_sem;
  
! #if !defined(HPUX_THREADS) && !defined(GC_OSF1_THREADS)
  /*
  To make sure that we're using LinuxThreads and not some other thread
  package, we generate a dummy reference to `pthread_kill_other_threads_np'
--- 459,466 ----
  
  sem_t GC_suspend_ack_sem;
  
! #if !defined(HPUX_THREADS) && !defined(GC_OSF1_THREADS) \
!     && !defined(FREEBSD_THREADS)
  /*
  To make sure that we're using LinuxThreads and not some other thread
  package, we generate a dummy reference to `pthread_kill_other_threads_np'
***************
*** 1067,1073 ****
  #       if defined(HPUX_THREADS)
  	  GC_nprocs = pthread_num_processors_np();
  #       endif
! #       if defined(OSF1_THREADS)
            GC_nprocs = 1;
  #       endif
  #	ifdef LINUX_THREADS
--- 1069,1075 ----
  #       if defined(HPUX_THREADS)
  	  GC_nprocs = pthread_num_processors_np();
  #       endif
! #       if defined(OSF1_THREADS) || defined(FREEBSD_THREADS)
            GC_nprocs = 1;
  #       endif
  #	ifdef LINUX_THREADS
***************
*** 1250,1255 ****
--- 1252,1262 ----
      /* cant have been recycled by pthreads.				*/
      UNLOCK();
      result = REAL_FUNC(pthread_join)(thread, retval);
+ # if defined (FREEBSD_THREADS)
+     /* For reasons unknown and undocumented, pthread_join() returns */
+     /* EINTR on occasion under FreeBSD yet the thread is actually gone. */
+     if (result == EINTR) result = 0;
+ # endif
      if (result == 0) {
          LOCK();
          /* Here the pthread thread id may have been recycled. */
Index: misc.c
===================================================================
RCS file: /cvs/gcc/egcs/boehm-gc/misc.c,v
retrieving revision 1.17
diff -c -r1.17 misc.c
*** misc.c	2001/08/18 01:04:43	1.17
--- misc.c	2001/08/21 06:12:36
***************
*** 56,62 ****
  	        pthread_t GC_lock_holder = NO_THREAD;
  #	      else
  #	        if defined(HPUX_THREADS) \
! 		   || defined(LINUX_THREADS) && !defined(USE_SPIN_LOCK)
  		  pthread_mutex_t GC_allocate_ml = PTHREAD_MUTEX_INITIALIZER;
  	          pthread_t GC_lock_holder = NO_THREAD;
  			/* Used only for assertions, and to prevent	 */
--- 56,64 ----
  	        pthread_t GC_lock_holder = NO_THREAD;
  #	      else
  #	        if defined(HPUX_THREADS) \
! 		   || defined(LINUX_THREADS) && !defined(USE_SPIN_LOCK) \
! 		   || defined(FREEBSD_THREADS)
! 
  		  pthread_mutex_t GC_allocate_ml = PTHREAD_MUTEX_INITIALIZER;
  	          pthread_t GC_lock_holder = NO_THREAD;
  			/* Used only for assertions, and to prevent	 */
***************
*** 528,534 ****
  	GC_init_netbsd_elf();
  #   endif
  #   if defined(IRIX_THREADS) || defined(LINUX_THREADS) \
!        || defined(HPUX_THREADS) || defined(SOLARIS_THREADS)
          GC_thr_init();
  #   endif
  #   ifdef SOLARIS_THREADS
--- 530,537 ----
  	GC_init_netbsd_elf();
  #   endif
  #   if defined(IRIX_THREADS) || defined(LINUX_THREADS) \
!        || defined(HPUX_THREADS) || defined(SOLARIS_THREADS) \
!        || defined(FREEBSD_THREADS)
          GC_thr_init();
  #   endif
  #   ifdef SOLARIS_THREADS
***************
*** 537,543 ****
  #   endif
  #   if !defined(THREADS) || defined(SOLARIS_THREADS) || defined(WIN32_THREADS) \
         || defined(IRIX_THREADS) || defined(LINUX_THREADS) \
!        || defined(HPUX_THREADS)
        if (GC_stackbottom == 0) {
  	GC_stackbottom = GC_get_stack_base();
  #       if defined(LINUX) && defined(IA64)
--- 540,546 ----
  #   endif
  #   if !defined(THREADS) || defined(SOLARIS_THREADS) || defined(WIN32_THREADS) \
         || defined(IRIX_THREADS) || defined(LINUX_THREADS) \
!        || defined(HPUX_THREADS) || defined(FREEBSD_THREADS)
        if (GC_stackbottom == 0) {
  	GC_stackbottom = GC_get_stack_base();
  #       if defined(LINUX) && defined(IA64)
Index: os_dep.c
===================================================================
RCS file: /cvs/gcc/egcs/boehm-gc/os_dep.c,v
retrieving revision 1.18
diff -c -r1.18 os_dep.c
*** os_dep.c	2001/08/18 01:04:43	1.18
--- os_dep.c	2001/08/21 06:12:37
***************
*** 1653,1659 ****
  
  # if defined(SOLARIS_THREADS) || defined(WIN32_THREADS) \
       || defined(IRIX_THREADS) || defined(LINUX_THREADS) \
!      || defined(HPUX_THREADS)
  
  extern void GC_push_all_stacks();
  
--- 1653,1659 ----
  
  # if defined(SOLARIS_THREADS) || defined(WIN32_THREADS) \
       || defined(IRIX_THREADS) || defined(LINUX_THREADS) \
!      || defined(HPUX_THREADS) || defined(FREEBSD_THREADS)
  
  extern void GC_push_all_stacks();
  
Index: threadlibs.c
===================================================================
RCS file: /cvs/gcc/egcs/boehm-gc/threadlibs.c,v
retrieving revision 1.7
diff -c -r1.7 threadlibs.c
*** threadlibs.c	2001/08/17 18:30:46	1.7
--- threadlibs.c	2001/08/21 06:12:37
***************
*** 24,29 ****
--- 24,32 ----
  #   ifdef GC_OSF1_THREADS
  	printf("-lpthread -lrt\n");
  #   endif
+ #   ifdef FREEBSD_THREADS
+ 	printf("-pthread\n");
+ #   endif
      return 0;
  }
  
Index: include/gc.h
===================================================================
RCS file: /cvs/gcc/egcs/boehm-gc/include/gc.h,v
retrieving revision 1.3
diff -c -r1.3 gc.h
*** gc.h	2001/08/18 01:04:43	1.3
--- gc.h	2001/08/21 06:12:37
***************
*** 66,72 ****
  #if !defined(_REENTRANT) && (defined(GC_SOLARIS_THREADS) \
  		             || defined(GC_SOLARIS_PTHREADS) \
  			     || defined(GC_HPUX_THREADS) \
! 			     || defined(GC_LINUX_THREADS))
  # define _REENTRANT
  	/* Better late than never.  This fails if system headers that	*/
  	/* depend on this were previously included.			*/
--- 66,73 ----
  #if !defined(_REENTRANT) && (defined(GC_SOLARIS_THREADS) \
  		             || defined(GC_SOLARIS_PTHREADS) \
  			     || defined(GC_HPUX_THREADS) \
! 			     || defined(GC_LINUX_THREADS) \
! 			     || defined(GC_FREEBSD_THREADS))
  # define _REENTRANT
  	/* Better late than never.  This fails if system headers that	*/
  	/* depend on this were previously included.			*/
***************
*** 817,830 ****
  #if !defined(GC_USE_LD_WRAP) && \
      (defined(GC_LINUX_THREADS) || defined(GC_HPUX_THREADS) || \
       defined(GC_IRIX_THREADS) || defined(GC_SOLARIS_PTHREADS) || \
!      defined(GC_SOLARIS_THREADS) || defined(GC_OSF1_THREADS))
  # include "gc_pthread_redirects.h"
  #endif
  
  # if defined(PCR) || defined(GC_SOLARIS_THREADS) || \
       defined(GC_SOLARIS_PTHREADS) || defined(GC_WIN32_THREADS) || \
       defined(GC_IRIX_THREADS) || defined(GC_LINUX_THREADS) || \
!      defined(GC_HPUX_THREADS)
     	/* Any flavor of threads except SRC_M3.	*/
  /* This returns a list of objects, linked through their first		*/
  /* word.  Its use can greatly reduce lock contention problems, since	*/
--- 818,832 ----
  #if !defined(GC_USE_LD_WRAP) && \
      (defined(GC_LINUX_THREADS) || defined(GC_HPUX_THREADS) || \
       defined(GC_IRIX_THREADS) || defined(GC_SOLARIS_PTHREADS) || \
!      defined(GC_SOLARIS_THREADS) || defined(GC_OSF1_THREADS) || \
!      defined(GC_FREEBSD_THREADS))
  # include "gc_pthread_redirects.h"
  #endif
  
  # if defined(PCR) || defined(GC_SOLARIS_THREADS) || \
       defined(GC_SOLARIS_PTHREADS) || defined(GC_WIN32_THREADS) || \
       defined(GC_IRIX_THREADS) || defined(GC_LINUX_THREADS) || \
!      defined(GC_HPUX_THREADS) || defined(GC_FREEBSD_THREADS)
     	/* Any flavor of threads except SRC_M3.	*/
  /* This returns a list of objects, linked through their first		*/
  /* word.  Its use can greatly reduce lock contention problems, since	*/
Index: include/gc_pthread_redirects.h
===================================================================
RCS file: /cvs/gcc/egcs/boehm-gc/include/gc_pthread_redirects.h,v
retrieving revision 1.2
diff -c -r1.2 gc_pthread_redirects.h
*** gc_pthread_redirects.h	2001/08/17 18:30:50	1.2
--- gc_pthread_redirects.h	2001/08/21 06:12:37
***************
*** 46,52 ****
  
  #if !defined(GC_USE_LD_WRAP) && \
      (defined(GC_IRIX_THREADS) || defined(GC_LINUX_THREADS) \
!      || defined(GC_HPUX_THREADS) || defined(GC_OSF1_THREADS))
  /* We treat these similarly. */
  # include <pthread.h>
  # include <signal.h>
--- 46,53 ----
  
  #if !defined(GC_USE_LD_WRAP) && \
      (defined(GC_IRIX_THREADS) || defined(GC_LINUX_THREADS) \
!      || defined(GC_HPUX_THREADS) || defined(GC_OSF1_THREADS) \
!      || defined(GC_FREEBSD_THREADS))
  /* We treat these similarly. */
  # include <pthread.h>
  # include <signal.h>
Index: include/private/gc_locks.h
===================================================================
RCS file: /cvs/gcc/egcs/boehm-gc/include/private/gc_locks.h,v
retrieving revision 1.3
diff -c -r1.3 gc_locks.h
*** gc_locks.h	2001/08/18 01:04:43	1.3
--- gc_locks.h	2001/08/21 06:12:37
***************
*** 262,268 ****
  #  endif
  
  #  if defined(LINUX_THREADS) || defined(OSF1_THREADS) \
!       || defined(HPUX_THREADS)
  #    define NO_THREAD (pthread_t)(-1)
  #    include <pthread.h>
  #    if defined(PARALLEL_MARK) 
--- 262,268 ----
  #  endif
  
  #  if defined(LINUX_THREADS) || defined(OSF1_THREADS) \
!       || defined(HPUX_THREADS) || defined(FREEBSD_THREADS)
  #    define NO_THREAD (pthread_t)(-1)
  #    include <pthread.h>
  #    if defined(PARALLEL_MARK) 
Index: include/private/gc_priv.h
===================================================================
RCS file: /cvs/gcc/egcs/boehm-gc/include/private/gc_priv.h,v
retrieving revision 1.3
diff -c -r1.3 gc_priv.h
*** gc_priv.h	2001/08/18 01:04:43	1.3
--- gc_priv.h	2001/08/21 06:12:37
***************
*** 452,458 ****
  #   if defined(SRC_M3) || defined(AMIGA) || defined(SOLARIS_THREADS) \
  	|| defined(MSWIN32) || defined(MSWINCE) || defined(MACOS) \
  	|| defined(DJGPP) || defined(NO_SIGNALS) || defined(IRIX_THREADS) \
! 	|| defined(LINUX_THREADS) 
  			/* Also useful for debugging.		*/
  	/* Should probably use thr_sigsetmask for SOLARIS_THREADS. */
  #     define DISABLE_SIGNALS()
--- 452,458 ----
  #   if defined(SRC_M3) || defined(AMIGA) || defined(SOLARIS_THREADS) \
  	|| defined(MSWIN32) || defined(MSWINCE) || defined(MACOS) \
  	|| defined(DJGPP) || defined(NO_SIGNALS) || defined(IRIX_THREADS) \
! 	|| defined(LINUX_THREADS) || defined(FREEBSD_THREADS)
  			/* Also useful for debugging.		*/
  	/* Should probably use thr_sigsetmask for SOLARIS_THREADS. */
  #     define DISABLE_SIGNALS()
***************
*** 481,487 ****
  # else
  #   if defined(SOLARIS_THREADS) || defined(WIN32_THREADS) \
  	|| defined(IRIX_THREADS) || defined(LINUX_THREADS) \
! 	|| defined(HPUX_THREADS)
        void GC_stop_world();
        void GC_start_world();
  #     define STOP_WORLD() GC_stop_world()
--- 481,487 ----
  # else
  #   if defined(SOLARIS_THREADS) || defined(WIN32_THREADS) \
  	|| defined(IRIX_THREADS) || defined(LINUX_THREADS) \
! 	|| defined(HPUX_THREADS) || defined(FREEBSD_THREADS)
        void GC_stop_world();
        void GC_start_world();
  #     define STOP_WORLD() GC_stop_world()
***************
*** 1926,1931 ****
--- 1926,1935 ----
  #   endif
  #  endif /* !SIG_SUSPEND */
    
+ # endif
+ # if defined(FREEBSD_THREADS)
+ #  define SIG_SUSPEND SIGUSR1
+ #  define SIG_THR_RESTART SIGUSR2
  # endif
  
  # endif /* GC_PRIVATE_H */
Index: include/private/gcconfig.h
===================================================================
RCS file: /cvs/gcc/egcs/boehm-gc/include/private/gcconfig.h,v
retrieving revision 1.4
diff -c -r1.4 gcconfig.h
*** gcconfig.h	2001/08/18 01:04:43	1.4
--- gcconfig.h	2001/08/21 06:12:37
***************
*** 1003,1010 ****
  #   endif
  #   ifdef FREEBSD
  #	define OS_TYPE "FREEBSD"
! #	define MPROTECT_VDB
  #	define FREEBSD_STACKBOTTOM
  #   endif
  #   ifdef NETBSD
  #	define OS_TYPE "NETBSD"
--- 1003,1012 ----
  #   endif
  #   ifdef FREEBSD
  #	define OS_TYPE "FREEBSD"
! #	ifndef GC_FREEBSD_THREADS
! #	    define MPROTECT_VDB
! #	endif
  #	define FREEBSD_STACKBOTTOM
  #   endif
  #   ifdef NETBSD
  #	define OS_TYPE "NETBSD"
***************
*** 1600,1605 ****
--- 1605,1613 ----
  #if defined(GC_OSF1_THREADS) && !defined(OSF1_THREADS)
  #   define OSF1_THREADS
  #endif
+ #if defined(GC_FREEBSD_THREADS) && !defined(FREEBSD_THREADS)
+ #   define FREEBSD_THREADS
+ #endif
  
  /* Internally we use SOLARIS_THREADS to test for either old or pthreads. */
  # if defined(_SOLARIS_PTHREADS) && !defined(SOLARIS_THREADS)
***************
*** 1626,1632 ****
  # if defined(PCR) || defined(SRC_M3) || \
  	defined(SOLARIS_THREADS) || defined(WIN32_THREADS) || \
  	defined(IRIX_THREADS) || defined(LINUX_THREADS) || \
! 	defined(HPUX_THREADS) || defined(OSF1_THREADS)
  #   define THREADS
  # endif
  
--- 1634,1641 ----
  # if defined(PCR) || defined(SRC_M3) || \
  	defined(SOLARIS_THREADS) || defined(WIN32_THREADS) || \
  	defined(IRIX_THREADS) || defined(LINUX_THREADS) || \
! 	defined(HPUX_THREADS) || defined(OSF1_THREADS) || \
! 	defined(FREEBSD_THREADS)
  #   define THREADS
  # endif
  
Index: tests/test.c
===================================================================
RCS file: /cvs/gcc/egcs/boehm-gc/tests/test.c,v
retrieving revision 1.4
diff -c -r1.4 test.c
*** test.c	2001/08/18 01:04:43	1.4
--- test.c	2001/08/21 06:12:37
***************
*** 64,70 ****
  #   include <synch.h>
  # endif
  
! # if defined(IRIX_THREADS) || defined(LINUX_THREADS) || defined(HPUX_THREADS)
  #   include <pthread.h>
  # endif
  
--- 64,71 ----
  #   include <synch.h>
  # endif
  
! # if defined(IRIX_THREADS) || defined(LINUX_THREADS) || defined(HPUX_THREADS) \
!      || defined(FREEBSD_THREADS)
  #   include <pthread.h>
  # endif
  
***************
*** 458,464 ****
  }
  
  # if defined(IRIX_THREADS) || defined(LINUX_THREADS) \
!      || defined(SOLARIS_PTHREADS) || defined(HPUX_THREADS)
      void fork_a_thread()
      {
        pthread_t t;
--- 459,466 ----
  }
  
  # if defined(IRIX_THREADS) || defined(LINUX_THREADS) \
!      || defined(SOLARIS_PTHREADS) || defined(HPUX_THREADS) \
!      || defined(FREEBSD_THREADS)
      void fork_a_thread()
      {
        pthread_t t;
***************
*** 653,659 ****
      static mutex_t incr_lock;
      mutex_lock(&incr_lock);
  # endif
! # if  defined(IRIX_THREADS) || defined(LINUX_THREADS) || defined(HPUX_THREADS)
      static pthread_mutex_t incr_lock = PTHREAD_MUTEX_INITIALIZER;
      pthread_mutex_lock(&incr_lock);
  # endif
--- 655,662 ----
      static mutex_t incr_lock;
      mutex_lock(&incr_lock);
  # endif
! # if  defined(IRIX_THREADS) || defined(LINUX_THREADS) || defined(HPUX_THREADS) \
!       || defined(FREEBSD_THREADS)
      static pthread_mutex_t incr_lock = PTHREAD_MUTEX_INITIALIZER;
      pthread_mutex_lock(&incr_lock);
  # endif
***************
*** 671,677 ****
  # ifdef SOLARIS_THREADS
      mutex_unlock(&incr_lock);
  # endif
! # if defined(IRIX_THREADS) || defined(LINUX_THREADS) || defined(HPUX_THREADS)
      pthread_mutex_unlock(&incr_lock);
  # endif
  # ifdef WIN32_THREADS
--- 674,681 ----
  # ifdef SOLARIS_THREADS
      mutex_unlock(&incr_lock);
  # endif
! # if defined(IRIX_THREADS) || defined(LINUX_THREADS) || defined(HPUX_THREADS) \
!      || defined(FREEBSD_THREADS)
      pthread_mutex_unlock(&incr_lock);
  # endif
  # ifdef WIN32_THREADS
***************
*** 745,751 ****
  	    mutex_lock(&incr_lock);
  #	  endif
  #         if defined(IRIX_THREADS) || defined(LINUX_THREADS) \
! 	     || defined(HPUX_THREADS)
              static pthread_mutex_t incr_lock = PTHREAD_MUTEX_INITIALIZER;
              pthread_mutex_lock(&incr_lock);
  #         endif
--- 749,755 ----
  	    mutex_lock(&incr_lock);
  #	  endif
  #         if defined(IRIX_THREADS) || defined(LINUX_THREADS) \
! 	     || defined(HPUX_THREADS) || defined(FREEBSD_THREADS)
              static pthread_mutex_t incr_lock = PTHREAD_MUTEX_INITIALIZER;
              pthread_mutex_lock(&incr_lock);
  #         endif
***************
*** 762,768 ****
  	    mutex_unlock(&incr_lock);
  #	  endif
  #	  if defined(IRIX_THREADS) || defined(LINUX_THREADS) \
! 	     || defined(HPUX_THREADS)
  	    pthread_mutex_unlock(&incr_lock);
  #	  endif
  #         ifdef WIN32_THREADS
--- 766,772 ----
  	    mutex_unlock(&incr_lock);
  #	  endif
  #	  if defined(IRIX_THREADS) || defined(LINUX_THREADS) \
! 	     || defined(HPUX_THREADS) || defined(FREEBSD_THREADS)
  	    pthread_mutex_unlock(&incr_lock);
  #	  endif
  #         ifdef WIN32_THREADS
***************
*** 868,874 ****
  
  # if defined(GC_SOLARIS_PTHREADS) || defined(GC_IRIX_THREADS) \
       || defined(GC_LINUX_THREADS) || defined(GC_HPUX_THREADS) \
!      || defined(GC_SOLARIS_THREADS)
  pthread_key_t fl_key;
  
  void * alloc8bytes()
--- 872,878 ----
  
  # if defined(GC_SOLARIS_PTHREADS) || defined(GC_IRIX_THREADS) \
       || defined(GC_LINUX_THREADS) || defined(GC_HPUX_THREADS) \
!      || defined(GC_SOLARIS_THREADS) || defined(GC_FREEBSD_THREADS)
  pthread_key_t fl_key;
  
  void * alloc8bytes()
***************
*** 1321,1327 ****
  #if !defined(PCR) && !defined(GC_SOLARIS_THREADS) \
      && !defined(GC_WIN32_THREADS) \
      && !defined(GC_IRIX_THREADS) && !defined(GC_LINUX_THREADS) \
!     && !defined(GC_HPUX_THREADS) || defined(LINT)
  #if defined(MSWIN32) && !defined(__MINGW32__)
    int APIENTRY WinMain(HINSTANCE instance, HINSTANCE prev, LPTSTR cmd, int n)
  #else
--- 1325,1332 ----
  #if !defined(PCR) && !defined(GC_SOLARIS_THREADS) \
      && !defined(GC_WIN32_THREADS) \
      && !defined(GC_IRIX_THREADS) && !defined(GC_LINUX_THREADS) \
!     && !defined(GC_HPUX_THREADS) && !defined(GC_FREEBSD_THREADS) \
!     || defined(LINT)
  #if defined(MSWIN32) && !defined(__MINGW32__)
    int APIENTRY WinMain(HINSTANCE instance, HINSTANCE prev, LPTSTR cmd, int n)
  #else
***************
*** 1558,1564 ****
  #endif
  
  #if defined(GC_SOLARIS_THREADS) || defined(GC_IRIX_THREADS) \
!  || defined(GC_HPUX_THREADS) || defined(GC_LINUX_THREADS)
  void * thr_run_one_test(void * arg)
  {
      run_one_test();
--- 1563,1570 ----
  #endif
  
  #if defined(GC_SOLARIS_THREADS) || defined(GC_IRIX_THREADS) \
!  || defined(GC_HPUX_THREADS) || defined(GC_LINUX_THREADS) \
!  || defined(FREEBSD_THREADS)
  void * thr_run_one_test(void * arg)
  {
      run_one_test();
***************
*** 1619,1625 ****
  	*((volatile char *)&code - 1024*1024) = 0;      /* Require 1 Mb */
  #   endif /* GC_IRIX_THREADS */
      pthread_attr_init(&attr);
! #   if defined(GC_IRIX_THREADS) || defined(GC_HPUX_THREADS)
      	pthread_attr_setstacksize(&attr, 1000000);
  #   endif
      n_tests = 0;
--- 1625,1632 ----
  	*((volatile char *)&code - 1024*1024) = 0;      /* Require 1 Mb */
  #   endif /* GC_IRIX_THREADS */
      pthread_attr_init(&attr);
! #   if defined(GC_IRIX_THREADS) || defined(GC_HPUX_THREADS) \
!        || defined(GC_FREEBSD_THREADS)
      	pthread_attr_setstacksize(&attr, 1000000);
  #   endif
      n_tests = 0;


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