The event loop needs to be woken up when an event is appended asynchronously; at present it only gets around to processing such events when a pre-existing event is fires.
2005-10-08 Andrew Cagney <cagney@redhat.com> * EventLoop.java: Extend Thread. Set .tid in .runEventLoop. Wrap .runEventLoop code in a try.finally to ensure that on return .isGoingToBlock is clear. * TestEventLoop.java: Add SleepThread to testAsync. * TestEventLoop.java: Add testAsync, and helper classes EventThread, TimerThread, and SignalThread. * EventLoop.java: Add private .tid, .isGoingToBlock, .wakeupIfBlocked. In constructor, add Sig.IO to the signal set. Instead of synchronised .timerEvents, .pendingEvents, and .signalHandlers, make the accessor methods synchronised. Add .wakeupIfBlocked calls, and updates to .isGoingToBlock where needed. * EventLoop.java: Add .remove, and .runEventLoop. Rewrite .runPending, .runPolling, and .run to use .runEventLoop. Replace .millisecondsToNextTimer with getTimerEventMillisecondTimeout. Relocate .requestStop, and .checForTimerEvents. * TestEventLoop.java: Use Tid.get, add .eventTid replacing Pid.get calls. 2005-10-07 Andrew Cagney <cagney@redhat.com> * EventLoop.java: Make pendingEvents a synchronizedList. Rename .appendEvent to .add. Add method .addToPending. * TestEventLoop.java: Update. * Signal.java: New. * SignalEvent.java: Extend Signal.java. * EventLoop.java: Update. Make .signalHandlers a Map. Rename .addHandler to .add. * TestEventLoop.java: Update. * TimerEvent.java: Add .getTimeMillis, modify .reSchedule so that it returns true if a re-schedule is required. Rename .value to .timeMillis, and .period to .periodMills, make private. * EventLoop.java: Update. Make .timerEvents a SortedMap, rename .addTimerEvent to .add, * TestEventLoop.java: Update. 2005-10-07 Andrew Cagney <cagney@redhat.com> * Tid.java, cni/Tid.cxx: New.