Hi,

I've committed the following patch which changes how the EventManager is created. This was causing all kinds of nasty problems during startup with gij.

Keith

2006-06-16  Keith Seitz  <[EMAIL PROTECTED]>

        * gnu/classpath/jdwp/event/EventManager.java (getDefault): Redo
        instantiation so that EventManager is created when getDefault
        is first called.
        * gnu/classpath/jdwp/Jdwp.java (Thread): Force creation
        of EventManager.
Index: gnu/classpath/jdwp/Jdwp.java
===================================================================
RCS file: /sources/classpath/classpath/gnu/classpath/jdwp/Jdwp.java,v
retrieving revision 1.7
diff -u -p -r1.7 Jdwp.java
--- gnu/classpath/jdwp/Jdwp.java	16 Jun 2006 18:32:48 -0000	1.7
+++ gnu/classpath/jdwp/Jdwp.java	16 Jun 2006 19:38:48 -0000
@@ -315,6 +315,13 @@ public class Jdwp
 	System.exit (1);
       }
 
+    /* Force creation of the EventManager. If the event manager
+       has not been created when isDebugging is set, it is possible
+       that the VM will call Jdwp.notify (which uses EventManager)
+       while the EventManager is being created (or at least this is
+       a problem with gcj/gij). */
+    EventManager.getDefault();
+
     // Now we are finally ready and initialized
     isDebugging = true;
   }
Index: gnu/classpath/jdwp/event/EventManager.java
===================================================================
RCS file: /sources/classpath/classpath/gnu/classpath/jdwp/event/EventManager.java,v
retrieving revision 1.4
diff -u -p -r1.4 EventManager.java
--- gnu/classpath/jdwp/event/EventManager.java	9 Mar 2006 23:18:29 -0000	1.4
+++ gnu/classpath/jdwp/event/EventManager.java	16 Jun 2006 19:38:49 -0000
@@ -1,5 +1,5 @@
 /* EventManager.java -- event management and notification infrastructure
-   Copyright (C) 2005 Free Software Foundation
+   Copyright (C) 2005, 2006 Free Software Foundation
 
 This file is part of GNU Classpath.
 
@@ -69,7 +69,7 @@ import java.util.Iterator;
 public class EventManager
 {
   // Single instance
-  private static EventManager _instance = new EventManager ();
+  private static EventManager _instance = null;
 
   // maps event (EVENT_*) to lists of EventRequests
   private Hashtable _requests = null;
@@ -79,8 +79,11 @@ public class EventManager
    *
    * @return the event manager
    */
-  public static EventManager getDefault ()
+  public static EventManager getDefault()
   {
+    if (_instance == null)
+      _instance = new EventManager();
+
     return _instance;
   }
 

Reply via email to