edu.utah.janosvm.kit.comm.amiga
Class SignalSet
java.lang.Object
|
+--edu.utah.janosvm.kit.comm.amiga.SignalSet
- public final class SignalSet
- extends java.lang.Object
A SignalSet is a JanosVM implementation of the Amiga's signal system.
Basically, it provides a simple, low level, low bandwidth mechanism for
threads to communicate with each other.
Method Summary |
int |
allocate()
|
void |
allocate(int bit)
|
void |
release(int bit)
|
void |
signal(int bit)
|
java.lang.String |
toString()
|
long |
waitFor(long mask)
Wait for one or more of the signals in the mask to be received. |
long |
waitFor(long mask,
long timeout)
Wait for one or more of the signals in the mask to be received, or
for a timeout. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait, wait0 |
MAXIMUM_SIGNAL_COUNT
public static final int MAXIMUM_SIGNAL_COUNT
allocatedSignals
private long allocatedSignals
- Mask of the signals that are currently allocated.
receivedSignals
private long receivedSignals
- Mask of signals that have been received so far.
waitSignals
private long waitSignals
- Mask of signals that the thread is waiting for at the moment.
SignalSet
public SignalSet()
allocate
public int allocate()
- Returns:
- A newly allocated signal number.
- Throws:
Throws
- an OutOfSignalsError if there are no more signal bits
available.
allocate
public void allocate(int bit)
- Parameters:
bit
- Allocate the given signal bit.
release
public void release(int bit)
- Parameters:
bit
- Release the allocated signal bit.
waitFor
public long waitFor(long mask,
long timeout)
throws java.lang.InterruptedException
- Wait for one or more of the signals in the mask to be received, or
for a timeout.
- Parameters:
mask
- The mask of signals to wait on.timeout
- The number of milliseconds to wait for signals.- Returns:
- The mask of signals received, which will be a subset of the
`mask' parameter.
waitFor
public long waitFor(long mask)
throws java.lang.InterruptedException
- Wait for one or more of the signals in the mask to be received.
- Parameters:
mask
- The mask of signals to wait on.- Returns:
- The mask of signals received, which will be a subset of the
`mask' parameter.
signal
public void signal(int bit)
- Parameters:
bit
- The signal bit number to send.
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
This documentation is Copyright (C) 2000-2003 The University of Utah. All Rights Reserved. See the documentation license for distribution terms and restrictions.
Documentation, software, and mailing lists for the JanosVM can be found at the Janos Project web page: http://www.cs.utah.edu/flux/janos/
Generated on Feb 13, 2003