public inbox for java@gcc.gnu.org
 help / color / mirror / Atom feed
* java.lang.Thread.start() doesn't work?
@ 2002-04-19  7:33 Lars Andersen
  2002-04-19  7:39 ` Andrew Haley
  2002-04-19  9:16 ` Anthony Green
  0 siblings, 2 replies; 6+ messages in thread
From: Lars Andersen @ 2002-04-19  7:33 UTC (permalink / raw)
  To: java

I'm running on the latest cvs-checkout on x86 linux. (one day old)

I can compile and run rather large and complex java-programs with gcj, 
but :

I can't make java.lang.Thread.start() work!

Here is an trivial example (More or less copied from the jdk1.3.1 
javadoc on java.lang.Thread :

 >>>

public class TestThread extends Thread
{
    public TestThread()
    {
    }
   
    public synchronized void start()
    {
    super.start();       
    }

    public void run()
    {
       for (int i=0; i<1000000000; i++) { if (i%10000000==0) 
System.out.print("."); }
    }
   
    public static void main(String args[])
    {
        TestThread p = new TestThread();
        new Thread(p).start();
    }
   
}

<<<

Needless to say, this code runs fine with sun jdk.

Compiled with gcj using :

gcj  TestThread.java  --main=TestThread


When running the resulting binary it produces the following output :

Exception in thread "main" java.lang.InternalError: Thread.start called 
but threads not available
   at 0x40266270: java.lang.Throwable.Throwable(java.lang.String) 
(/usr/local/lib/libgcj.so.3)
   at 0x402551f6: java.lang.Error.Error(java.lang.String) 
(/usr/local/lib/libgcj.so.3)
   at 0x40266606: 
java.lang.VirtualMachineError.VirtualMachineError(java.lang.String) 
(/usr/local/lib/libgcj.so.3)
   at 0x40257396: 
java.lang.InternalError.InternalError(java.lang.String) 
(/usr/local/lib/libgcj.so.3)
   at 0x403d4928: _Jv_ThreadStart(java.lang.Thread, int, void 
()(java.lang.Thread)) (/usr/local/lib/libgcj.so.3)
   at 0x40247f51: java.lang.Thread.start() (/usr/local/lib/libgcj.so.3)
   at 0x0804906e: ?? (/home/gb/rpm/BUILD/glibc-2.2.4/csu/init.c:0)
   at 0x4023c728: gnu.gcj.runtime.FirstThread.call_main() 
(/usr/local/lib/libgcj.so.3)
   at 0x402c5268: gnu.gcj.runtime.FirstThread.run() 
(/usr/local/lib/libgcj.so.3)
   at 0x40247ebc: _Jv_ThreadRun(java.lang.Thread) 
(/usr/local/lib/libgcj.so.3)
   at 0x40221464: _Jv_RunMain(java.lang.Class, byte const, int, byte 
const, boolean) (/usr/local/lib/libgcj.so.3)
   at 0x4022158d: JvRunMain (/usr/local/lib/libgcj.so.3)
   at 0x08048dd4: ?? (/home/gb/rpm/BUILD/glibc-2.2.4/csu/init.c:0)
   at 0x40609280: __libc_start_main (/lib/libc.so.6)
   at 0x08048cb1: _start (??:0)

Since java.lang.Thread is in libgcj, I would expect this code to work?

/Lars Andersen 

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2002-04-19 18:54 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-04-19  7:33 java.lang.Thread.start() doesn't work? Lars Andersen
2002-04-19  7:39 ` Andrew Haley
2002-04-19  9:16 ` Anthony Green
2002-04-19 11:04   ` Lars Andersen
2002-04-19 11:30     ` Tom Tromey
2002-04-19 15:45     ` Anthony Green

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).