frysk.sys
Class Poll

java.lang.Object
  extended by frysk.sys.Poll

public final class Poll
extends Object

Poll like interface for waiting on kernel events. This object, loosely based on the poll and pselect interfaces, provides a call blocks until a UNIX event (signal, FD ready), the timeout expires, or an unexpected interrupt occures. The client (which extends this object) is notified via the abstract notify methods.


Nested Class Summary
static class Poll.Fds
          Manage the file descriptors watched by the poll call.
 
Field Summary
protected static Poll.Fds pollFds
           
protected static SignalSet signalSet
          Set of signals checked during poll.
 
Constructor Summary
Poll()
           
 
Method Summary
static void add(Signal sig)
          Add Sig to the set of signals checked during poll.
private static void addSignalHandler(Signal sig)
           
static void empty()
          Empty the set of signals, and file descriptors, checked during poll.
static void poll(PollBuilder observer, long timeout)
          Poll the system for either FD, or signal events.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

signalSet

protected static SignalSet signalSet
Set of signals checked during poll.


pollFds

protected static Poll.Fds pollFds
Constructor Detail

Poll

public Poll()
Method Detail

addSignalHandler

private static void addSignalHandler(Signal sig)

add

public static void add(Signal sig)
Add Sig to the set of signals checked during poll.


empty

public static void empty()
Empty the set of signals, and file descriptors, checked during poll.


poll

public static void poll(PollBuilder observer,
                        long timeout)
Poll the system for either FD, or signal events. Block for timeout milliseconds (if timeout is +ve or zero), or until the next event (if timeout is -ve). Return when an event might have occured.