Bug 1399

Summary: event loop needs to wake up when an event is added asynchronously
Product: frysk Reporter: Andrew Cagney <cagney>
Component: generalAssignee: Andrew Cagney <cagney>
Severity: normal CC: pmuldoon
Priority: P1    
Version: unspecified   
Target Milestone: ---   
Host: Target:
Build: Last reconfirmed:
Bug Depends on:    
Bug Blocks: 1580    

Description Andrew Cagney 2005-09-30 16:15:28 UTC
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.
Comment 1 Andrew Cagney 2005-10-08 16:40:13 UTC
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

        * 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

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.