home *** CD-ROM | disk | FTP | other *** search
- package sun.awt;
-
- import java.awt.AWTEvent;
- import java.awt.EventQueue;
-
- class PostEventQueue extends Thread {
- private static int threadNum = 0;
- private EventQueueItem queueHead = null;
- private EventQueueItem queueTail = null;
- private boolean keepGoing = true;
- private final EventQueue eventQueue;
- // $FF: synthetic field
- static Class class$sun$awt$PostEventQueue;
-
- PostEventQueue(EventQueue var1) {
- super("SunToolkit.PostEventQueue-" + threadNum);
- Class var2 = class$sun$awt$PostEventQueue == null ? (class$sun$awt$PostEventQueue = class$("sun.awt.PostEventQueue")) : class$sun$awt$PostEventQueue;
- synchronized(var2) {
- ++threadNum;
- }
-
- this.eventQueue = var1;
- ((Thread)this).start();
- }
-
- public void run() {
- while(this.keepGoing && !((Thread)this).isInterrupted()) {
- try {
- EventQueueItem var1;
- synchronized(this) {
- while(this.keepGoing && this.queueHead == null) {
- this.notifyAll();
- this.wait();
- }
-
- if (!this.keepGoing) {
- break;
- }
-
- var1 = this.queueHead;
- }
-
- this.eventQueue.postEvent(var1.event);
- synchronized(this) {
- this.queueHead = this.queueHead.next;
- if (this.queueHead == null) {
- this.queueTail = null;
- }
- }
- } catch (InterruptedException var9) {
- this.keepGoing = false;
- synchronized(this) {
- this.notifyAll();
- }
- }
- }
-
- }
-
- synchronized void postEvent(AWTEvent var1) {
- EventQueueItem var2 = new EventQueueItem(var1);
- if (this.queueHead == null) {
- this.queueHead = this.queueTail = var2;
- this.notifyAll();
- } else {
- this.queueTail.next = var2;
- this.queueTail = var2;
- }
-
- }
-
- void flush() {
- if (Thread.currentThread() != this) {
- synchronized(this) {
- if (this.queueHead != null) {
- try {
- this.wait();
- } catch (InterruptedException var4) {
- }
- }
-
- }
- }
- }
-
- synchronized void quitRunning() {
- this.keepGoing = false;
- this.notifyAll();
- }
-
- // $FF: synthetic method
- static Class class$(String var0) {
- try {
- return Class.forName(var0);
- } catch (ClassNotFoundException var2) {
- throw new NoClassDefFoundError(((Throwable)var2).getMessage());
- }
- }
- }
-