/[gzz]/gzz/gzz/client/awt/JUpdateManager.java
ViewVC logotype

Diff of /gzz/gzz/client/awt/JUpdateManager.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.9 by tjl, Fri Feb 21 20:02:37 2003 UTC revision 1.10 by benja, Thu Mar 13 18:44:43 2003 UTC
# Line 55  public static final String rcsid = "$Id$ Line 55  public static final String rcsid = "$Id$
55    
56      private static List eventList = new LinkedList();      private static List eventList = new LinkedList();
57      public static void addEvent(EventProcessor proc, AWTEvent e) {      public static void addEvent(EventProcessor proc, AWTEvent e) {
58          synchronized(eventList) {          JUpdateManager m = (JUpdateManager)instance;
59            synchronized(m.ordering) {
60              eventList.add(proc);              eventList.add(proc);
61              eventList.add(e);              eventList.add(e);
62              eventList.notifyAll();              m.ordering.notifyAll();
63              if(dbg) pa("Queue "+e+"; listlen="+eventList.size());              if(dbg) pa("Queue "+e+"; listlen="+eventList.size());
64          }          }
65      }      }
# Line 93  public static final String rcsid = "$Id$ Line 94  public static final String rcsid = "$Id$
94              got = true;              got = true;
95              EventProcessor proc;              EventProcessor proc;
96              AWTEvent evt;              AWTEvent evt;
97              synchronized(eventList) {              synchronized(ordering) {
98                  proc = (EventProcessor)eventList.get(0);                  proc = (EventProcessor)eventList.get(0);
99                  evt = (AWTEvent)eventList.get(1);                  evt = (AWTEvent)eventList.get(1);
100                  eventList.remove(1);                  eventList.remove(1);
# Line 109  public static final String rcsid = "$Id$ Line 110  public static final String rcsid = "$Id$
110      protected boolean handleEvents(boolean waitForEvent) {      protected boolean handleEvents(boolean waitForEvent) {
111          if(!waitForEvent)          if(!waitForEvent)
112              return handleEvents_nohang();              return handleEvents_nohang();
113          synchronized(eventList) {          synchronized(ordering) {
114              while(!handleEvents_nohang()) {              if(handleEvents_nohang()) return true;
115                  try {              try {
116                      p("JUpdateManager: going to wait for next event");                  p("JUpdateManager: going to wait for next event");
117                      eventList.wait();                  // We wait on 'ordering' since that is also
118                  } catch(InterruptedException e) {                  // what is notified by AbstractUpdateManager.chg()
119                      pa("JUpdateManager: interrupted??");                  ordering.wait();
120                  }              } catch(InterruptedException e) {
121                    pa("JUpdateManager: interrupted??");
122              }              }
123                return handleEvents_nohang();
124          }          }
         return true;  
125      }      }
126  }  }

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.10

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26