private static Queue events = new Queue(50);
/** the number of objects in the queue that are not subclasses of ThreadMessage */
- private static volatile int nonThreadEventsInQueue = 0;
+ public static volatile int nonThreadEventsInQueue = 0;
/** the message currently being performed */
static Message currentlyPerforming = null;
public Filter(InputStream is) { super(is); }
public int read() throws IOException {
Thread.yield();
- while(MessageQueue.working) try { Thread.sleep(100); } catch (Exception e) { };
+ while(MessageQueue.nonThreadEventsInQueue > 0) try { Thread.sleep(100); } catch (Exception e) { };
return super.read();
}
public int read(byte[] b) throws IOException {
Thread.yield();
- while(MessageQueue.working) try { Thread.sleep(100); } catch (Exception e) { };
+ while(MessageQueue.nonThreadEventsInQueue > 0) try { Thread.sleep(100); } catch (Exception e) { };
return super.read(b);
}
public int read(byte[] b, int i, int j) throws IOException {
Thread.yield();
- while(MessageQueue.working) try { Thread.sleep(100); } catch (Exception e) { };
+ while(MessageQueue.nonThreadEventsInQueue > 0) try { Thread.sleep(100); } catch (Exception e) { };
return super.read(b, i, j);
}
}