Status fields:
creation_ts: | 2008-03-27 14:54 |
---|---|
component: | vm |
version: | default branch |
rep_platform: | All |
op_sys: | Linux |
bug_status: | RESOLVED |
resolution: | FIXED |
reporter: | twisti@complang.tuwien.ac.at |
This test exits immediately when running with java binary of OpenJDK, while it works with the cacao binary: public class test extends Thread { public static void main(String[] argv) throws Throwable { Runnable worker = new Runnable() { public void run() { try { for (int i = 0; i < 5; i++) { Thread.sleep(1000); System.out.print("."); } } catch (Exception e) { e.printStackTrace(); } } }; new Thread(worker).start(); } }
The problem was that the OpenJDK java binary detaches the main thread from the VM and there is no non-daemon thread anymore. But HotSpot attaches the main thread again, as DestroyJavaVM thread, in DestroyJavaVM. This changeset implements this behavior: http://mips.complang.tuwien.ac.at/hg/cacao/rev/5b1738cbdeac