From 947b8814056ea2fba6bbcfab86591f74bffc0311 Mon Sep 17 00:00:00 2001 From: tromey Date: Fri, 23 Sep 2005 21:31:04 +0000 Subject: Imported Classpath 0.18. * sources.am, Makefile.in: Updated. * Makefile.am (nat_source_files): Removed natProxy.cc. * java/lang/reflect/natProxy.cc: Removed. * gnu/classpath/jdwp/VMFrame.java, gnu/classpath/jdwp/VMIdManager.java, gnu/classpath/jdwp/VMVirtualMachine.java, java/lang/reflect/VMProxy.java: New files. 2005-09-23 Thomas Fitzsimmons * scripts/makemake.tcl (verbose): Add gnu/java/awt/peer/qt to BC list. 2005-09-23 Thomas Fitzsimmons * gnu/java/net/DefaultContentHandlerFactory.java (getContent): Remove ClasspathToolkit references. 2005-09-23 Thomas Fitzsimmons * gnu/awt/xlib/XCanvasPeer.java: Add new peer methods. * gnu/awt/xlib/XFramePeer.java: Likewise. * gnu/awt/xlib/XGraphicsConfiguration.java: Likewise. 2005-09-23 Thomas Fitzsimmons * Makefile.am (libgcjawt_la_SOURCES): Remove jawt.c. Add classpath/native/jawt/jawt.c. * Makefile.in: Regenerate. * jawt.c: Remove file. * include/Makefile.am (tool_include__HEADERS): Remove jawt.h and jawt_md.h. Add ../classpath/include/jawt.h and ../classpath/include/jawt_md.h. * include/Makefile.in: Regenerate. * include/jawt.h: Regenerate. * include/jawt_md.h: Regenerate. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@104586 138bc75d-0d04-0410-961f-82ee72b054a4 --- libjava/classpath/java/awt/EventQueue.java | 75 +++++++----------------------- 1 file changed, 16 insertions(+), 59 deletions(-) (limited to 'libjava/classpath/java/awt/EventQueue.java') diff --git a/libjava/classpath/java/awt/EventQueue.java b/libjava/classpath/java/awt/EventQueue.java index a8b00781321..15b6e1e7afd 100644 --- a/libjava/classpath/java/awt/EventQueue.java +++ b/libjava/classpath/java/awt/EventQueue.java @@ -38,8 +38,6 @@ exception statement from your version. */ package java.awt; -import gnu.java.awt.ClasspathToolkit; - import java.awt.event.ActionEvent; import java.awt.event.InputEvent; import java.awt.event.InputMethodEvent; @@ -78,10 +76,7 @@ public class EventQueue private EventDispatchThread dispatchThread = new EventDispatchThread(this); private boolean shutdown = false; - private long lastNativeQueueAccess = 0; - private long humanLatencyThreshold = 100; - - synchronized void setShutdown (boolean b) + synchronized private void setShutdown (boolean b) { shutdown = b; } @@ -94,8 +89,8 @@ public class EventQueue // This is the exact self-shutdown condition specified in J2SE: // http://java.sun.com/j2se/1.4.2/docs/api/java/awt/doc-files/AWTThreadIssues.html - if (peekEvent() == null - && ((ClasspathToolkit) Toolkit.getDefaultToolkit()).nativeQueueEmpty()) + // FIXME: check somewhere that the native queue is empty + if (peekEvent() == null) { Frame[] frames = Frame.getFrames(); for (int i = 0; i < frames.length; ++i) @@ -127,50 +122,22 @@ public class EventQueue { if (next != null) return next.getNextEvent(); - - ClasspathToolkit tk = ((ClasspathToolkit) Toolkit.getDefaultToolkit()); - long curr = System.currentTimeMillis(); - - if (! tk.nativeQueueEmpty() && - (curr - lastNativeQueueAccess > humanLatencyThreshold)) - { - tk.iterateNativeQueue(this, false); - lastNativeQueueAccess = curr; - } while (next_in == next_out) { - // Only the EventDispatchThread associated with the top of the stack is - // allowed to get events from the native source; everyone else just - // waits on the head of the queue. - - if (isDispatchThread()) - { - // We are not allowed to return null from this method, yet it - // is possible that we actually have run out of native events - // in the enclosing while() loop, and none of the native events - // happened to cause AWT events. We therefore ought to check - // the isShutdown() condition here, before risking a "native - // wait". If we check it before entering this function we may - // wait forever for events after the shutdown condition has - // arisen. - - if (isShutdown()) - throw new InterruptedException(); - - tk.iterateNativeQueue(this, true); - lastNativeQueueAccess = System.currentTimeMillis(); - } - else - { - try - { - wait(); - } - catch (InterruptedException ie) - { - } - } + // We are not allowed to return null from this method, yet it + // is possible that we actually have run out of native events + // in the enclosing while() loop, and none of the native events + // happened to cause AWT events. We therefore ought to check + // the isShutdown() condition here, before risking a "native + // wait". If we check it before entering this function we may + // wait forever for events after the shutdown condition has + // arisen. + + if (isShutdown()) + throw new InterruptedException(); + + wait(); } AWTEvent res = queue[next_out]; @@ -298,15 +265,6 @@ public class EventQueue dispatchThread.start(); } - // Window events might represent the closing of a window, which - // might cause the end of the dispatch thread's life, so we'll wake - // it up here to give it a chance to check for shutdown. - - if (!isDispatchThread() - || (evt.getID() == WindowEvent.WINDOW_CLOSED) - || (evt.getID() == WindowEvent.WINDOW_CLOSING)) - ((ClasspathToolkit) Toolkit.getDefaultToolkit()).wakeNativeQueue(); - notify(); } @@ -478,7 +436,6 @@ public class EventQueue next_in = 0; next_out = 0; - ((ClasspathToolkit) Toolkit.getDefaultToolkit()).wakeNativeQueue(); setShutdown(true); dispatchThread = null; this.notifyAll(); -- cgit v1.2.1