/[classpath]/classpath/java/awt/EventQueue.java
ViewVC logotype

Diff of /classpath/java/awt/EventQueue.java

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

revision 1.19 by mkoch, Tue Jan 11 15:06:04 2005 UTC revision 1.20 by mkoch, Tue Jan 18 09:43:45 2005 UTC
# Line 76  public class EventQueue Line 76  public class EventQueue
76    private EventDispatchThread dispatchThread = new EventDispatchThread(this);    private EventDispatchThread dispatchThread = new EventDispatchThread(this);
77    private boolean shutdown = false;    private boolean shutdown = false;
78    
79      private long lastNativeQueueAccess = 0;
80      private long humanLatencyThreshold = 100;
81    
82    synchronized void setShutdown (boolean b)    synchronized void setShutdown (boolean b)
83    {    {
84      shutdown = b;      shutdown = b;
# Line 122  public class EventQueue Line 125  public class EventQueue
125    {    {
126      if (next != null)      if (next != null)
127        return next.getNextEvent();        return next.getNextEvent();
128        
129        ClasspathToolkit tk = ((ClasspathToolkit) Toolkit.getDefaultToolkit());
130        long curr = System.currentTimeMillis();
131    
132        if (! tk.nativeQueueEmpty() &&
133            (curr - lastNativeQueueAccess > humanLatencyThreshold))
134          {
135            tk.iterateNativeQueue(this, false);
136            lastNativeQueueAccess = curr;
137          }
138    
139      while (next_in == next_out)      while (next_in == next_out)
140        {        {
# Line 143  public class EventQueue Line 156  public class EventQueue
156              if (isShutdown())              if (isShutdown())
157                throw new InterruptedException();                throw new InterruptedException();
158    
159              ((ClasspathToolkit) Toolkit.getDefaultToolkit()).iterateNativeQueue(this);              tk.iterateNativeQueue(this, true);
160                lastNativeQueueAccess = System.currentTimeMillis();
161            }            }
162          else          else
163            {            {

Legend:
Removed from v.1.19  
changed lines
  Added in v.1.20

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