/[libvob]/libvob/org/nongnu/libvob/impl/awt/JUpdateManager.java
ViewVC logotype

Diff of /libvob/org/nongnu/libvob/impl/awt/JUpdateManager.java

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

revision 1.2 by tjl, Fri Mar 7 11:38:21 2003 UTC revision 1.3 by benja, Mon Mar 17 09:55:26 2003 UTC
# Line 51  public static final String rcsid = "$Id$ Line 51  public static final String rcsid = "$Id$
51    
52      private static List eventList = new LinkedList();      private static List eventList = new LinkedList();
53      public static void addEvent(EventProcessor proc, AWTEvent e) {      public static void addEvent(EventProcessor proc, AWTEvent e) {
54          synchronized(eventList) {          JUpdateManager m = (JUpdateManager)instance;
55            synchronized(m.ordering) {
56              eventList.add(proc);              eventList.add(proc);
57              eventList.add(e);              eventList.add(e);
58              eventList.notifyAll();              m.ordering.notifyAll();
59              if(dbg) pa("Queue "+e+"; listlen="+eventList.size());              if(dbg) pa("Queue "+e+"; listlen="+eventList.size());
60          }          }
61      }      }
# Line 89  public static final String rcsid = "$Id$ Line 90  public static final String rcsid = "$Id$
90              got = true;              got = true;
91              EventProcessor proc;              EventProcessor proc;
92              AWTEvent evt;              AWTEvent evt;
93              synchronized(eventList) {              synchronized(ordering) {
94                  proc = (EventProcessor)eventList.get(0);                  proc = (EventProcessor)eventList.get(0);
95                  evt = (AWTEvent)eventList.get(1);                  evt = (AWTEvent)eventList.get(1);
96                  eventList.remove(1);                  eventList.remove(1);
# Line 105  public static final String rcsid = "$Id$ Line 106  public static final String rcsid = "$Id$
106      protected boolean handleEvents(boolean waitForEvent) {      protected boolean handleEvents(boolean waitForEvent) {
107          if(!waitForEvent)          if(!waitForEvent)
108              return handleEvents_nohang();              return handleEvents_nohang();
109          synchronized(eventList) {          synchronized(ordering) {
110              while(!handleEvents_nohang()) {              if(handleEvents_nohang()) return true;
111                  try {              try {
112                      p("JUpdateManager: going to wait for next event");                  p("JUpdateManager: going to wait for next event");
113                      eventList.wait();                  // We wait on 'ordering' since that is also
114                  } catch(InterruptedException e) {                  // what is notified by AbstractUpdateManager.chg()
115                      pa("JUpdateManager: interrupted??");                  ordering.wait();
116                  }              } catch(InterruptedException e) {
117                    pa("JUpdateManager: interrupted??");
118              }              }
119                return handleEvents_nohang();
120          }          }
         return true;  
121      }      }
122  }  }

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

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