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: Fix for no-threads -vs- hash synchronization


This patch fixes a build failure that occurs when you configure the
trunk without threads on a system where hash synchronization is
enabled by default.  I'm checking this in.

2001-05-24  Tom Tromey  <tromey@redhat.com>

	* configure.in: Only allow hash synchronization when POSIX threads
	are enabled.
	* java/lang/natObject.cc (alloc_heavy): Properly find `init' field
	of sync info object.

Tom

Index: configure.in
===================================================================
RCS file: /cvs/gcc/gcc/libjava/configure.in,v
retrieving revision 1.86
diff -u -r1.86 configure.in
--- configure.in	2001/05/24 05:40:36	1.86
+++ configure.in	2001/05/24 18:01:48
@@ -75,12 +75,6 @@
 if test -z "$enable_hash_synchronization"; then
    enable_hash_synchronization=$enable_hash_synchronization_default
 fi
-HASH_SYNC_SPEC=
-if test "$enable_hash_synchronization" = yes; then
-   HASH_SYNC_SPEC=-fhash-synchronization
-   AC_DEFINE(JV_HASH_SYNCHRONIZATION)
-fi
-AC_SUBST(HASH_SYNC_SPEC)
 
 
 dnl See if the user has requested runtime debugging.
@@ -358,6 +352,15 @@
 AC_SUBST(THREADDEPS)
 AC_SUBST(THREADOBJS)
 AC_SUBST(THREADSPEC)
+
+HASH_SYNC_SPEC=
+# Hash synchronization is only useful with posix threads right now.
+if test "$enable_hash_synchronization" = yes && test "$THREADS" = "posix"; then
+   HASH_SYNC_SPEC=-fhash-synchronization
+   AC_DEFINE(JV_HASH_SYNCHRONIZATION)
+fi
+AC_SUBST(HASH_SYNC_SPEC)
+
 
 AM_CONDITIONAL(USING_GCC, test "$GCC" = yes)
 

Index: java/lang/natObject.cc
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/lang/natObject.cc,v
retrieving revision 1.15
diff -u -r1.15 natObject.cc
--- natObject.cc	2001/05/24 05:40:37	1.15
+++ natObject.cc	2001/05/24 18:02:47
@@ -691,7 +691,7 @@
   _Jv_MutexInit (&(hl -> si.mutex));
   _Jv_CondInit (&(hl -> si.condition));
 # if defined (_Jv_HaveCondDestroy) || defined (_Jv_HaveMutexDestroy)
-    si->init = true;  // needed ?
+    hl->si.init = true;  // needed ?
 # endif
   hl -> next = he -> heavy_locks;
   he -> heavy_locks = hl;


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