This is the mail archive of the
java-patches@sourceware.cygnus.com
mailing list for the Java project.
Patch: really fail with no threads
- To: Java Patch List <java-patches at sourceware dot cygnus dot com>
- Subject: Patch: really fail with no threads
- From: Tom Tromey <tromey at cygnus dot com>
- Date: 18 Nov 1999 00:33:37 -0700
- Reply-To: tromey at cygnus dot com
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);
}