Index: Main.java =================================================================== RCS file: /cvs/core/src/org/netbeans/core/Main.java,v retrieving revision 1.166 diff -u -r1.166 Main.java --- Main.java 12 Jun 2003 17:23:08 -0000 1.166 +++ Main.java 16 Jul 2003 13:48:28 -0000 @@ -96,10 +96,11 @@ /** Starts TopThreadGroup which properly overrides uncaughtException * Further - new thread in the group execs main */ - public static void main (String[] argv) { + public static void main (String[] argv) throws Exception { TopThreadGroup tg = new TopThreadGroup ("IDE Main", argv); // NOI18N - programatic name StartLog.logStart ("Forwarding to topThreadGroup"); // NOI18N tg.start (); + System.out.println("FINISHED!!!!"); } Index: TopThreadGroup.java =================================================================== RCS file: /cvs/core/src/org/netbeans/core/TopThreadGroup.java,v retrieving revision 1.19 diff -u -r1.19 TopThreadGroup.java --- TopThreadGroup.java 15 May 2003 06:32:37 -0000 1.19 +++ TopThreadGroup.java 16 Jul 2003 13:48:28 -0000 @@ -23,6 +23,8 @@ final class TopThreadGroup extends ThreadGroup implements Runnable { /** The command line args */ private String[] args; + /** flag that indicates whether the main thread had finished or not */ + private boolean finished; /** Constructs a new thread group. The parent of this new group is * the thread group of the currently running thread. @@ -70,9 +72,13 @@ } } - public void start () { + public synchronized void start () throws InterruptedException { Thread t = new Thread (this, this, "main"); // NOI18N t.start (); + + while (!finished) { + wait (); + } } public void run() { @@ -81,6 +87,11 @@ } catch (Throwable t) { // XXX is this not handled by uncaughtException? ErrorManager.getDefault().notify(t); + } finally { + synchronized (this) { + finished = true; + notify (); + } } } }