This is the mail archive of the java-patches@sourceware.cygnus.com 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: really fail with no threads


I'm committing this patch, which causes the no-threads thread package
to reliably fail when a second thread is started.  This was reported
by Godmar Back.

1999-11-18  Tom Tromey  <tromey@cygnus.com>

	* no-threads.cc (_Jv_ThreadStart): Use JvFail and not JvAssert.

Tom

Index: no-threads.cc
===================================================================
RCS file: /cvs/java/libgcj/libjava/no-threads.cc,v
retrieving revision 1.2
diff -u -r1.2 no-threads.cc
--- no-threads.cc	1999/09/10 22:03:05	1.2
+++ no-threads.cc	1999/11/18 07:28:31
@@ -20,7 +20,10 @@
 _Jv_ThreadStart (java::lang::Thread *thread, _Jv_Thread_t *,
 		 _Jv_ThreadStartFunc *meth)
 {
-  JvAssert (! _Jv_OnlyThread);
+  // Don't use JvAssert, since we want this to fail even when compiled
+  // without assertions.
+  if (_Jv_OnlyThread)
+    JvFail ("only thread already running");
   _Jv_OnlyThread = thread;
   (*meth) (thread);
 }

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