drcl.sim.event
Class SEThread
java.lang.Object
java.lang.Thread
drcl.comp.WorkerThread
drcl.sim.event.SEThread
- All Implemented Interfaces:
- java.lang.Runnable
- public class SEThread
- extends WorkerThread
- See Also:
SESimulator
|
Field Summary |
protected SESimulator |
aruntime
The worker runtime of this thread. |
protected java.lang.Object |
sleepOn
The object that this thread waits on. |
| Fields inherited from class drcl.comp.WorkerThread |
currentContext, mainContext, returnPort, runtime, state, State_ACTIVE, State_FINISHING, State_INACTIVE, State_SLEEPING, State_WAITING, totalNumEvents |
| Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
|
Constructor Summary |
SEThread()
|
SEThread(java.lang.ThreadGroup group_,
java.lang.String name_)
|
|
Method Summary |
protected void |
__sleepOn(java.lang.Object sleepOn_,
java.lang.String prestate_,
java.lang.String poststate_)
|
java.lang.String |
_toString()
|
protected void |
changeCurrentContext(Port port_,
java.lang.Object data_,
java.lang.String state_)
|
java.lang.String |
info(java.lang.String prefix_)
|
boolean |
isReadyForNextTask()
|
void |
kill()
Let go of the thread from sleep in idle. |
protected void |
lock(Component host_,
java.lang.Object o_)
|
java.lang.String |
locks()
|
protected void |
notify(Component host_,
java.lang.Object o_)
|
protected void |
notifyAll(Component host_,
java.lang.Object o_)
|
protected void |
releaseAllLocks(Component host_)
|
void |
run()
Standard Thread.run(). |
protected void |
setState(java.lang.String new_)
|
protected void |
sleepFor(double time_)
|
protected void |
sleepUntil(double time_)
|
void |
start()
Delay the starting until the time specified later(second). |
protected void |
unlock(Component host_,
java.lang.Object o_)
|
protected void |
unlock(Component host_,
java.lang.Object o_,
boolean release_)
|
protected void |
wait(Component host_,
java.lang.Object o_)
|
protected void |
yieldToRuntime()
Returns the thread that is holding the lock of the target object. |
| Methods inherited from class drcl.comp.WorkerThread |
_debug, _getName, finishing, getNumEvents, getState, getTime, info, isOrphan, isWaiting, resumeComponent, startComponent, stopComponent, toString |
| Methods inherited from class java.lang.Thread |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, stop, stop, suspend, yield |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
aruntime
protected SESimulator aruntime
- The worker runtime of this thread.
sleepOn
protected transient java.lang.Object sleepOn
- The object that this thread waits on.
SEThread
public SEThread()
SEThread
public SEThread(java.lang.ThreadGroup group_,
java.lang.String name_)
info
public java.lang.String info(java.lang.String prefix_)
- Specified by:
info in class WorkerThread
_toString
public java.lang.String _toString()
start
public void start()
- Delay the starting until the time specified later(second).
__sleepOn
protected final void __sleepOn(java.lang.Object sleepOn_,
java.lang.String prestate_,
java.lang.String poststate_)
run
public void run()
- Standard Thread.run().
sleepFor
protected final void sleepFor(double time_)
- Specified by:
sleepFor in class WorkerThread
sleepUntil
protected final void sleepUntil(double time_)
- Specified by:
sleepUntil in class WorkerThread
kill
public void kill()
- Let go of the thread from sleep in idle.
changeCurrentContext
protected void changeCurrentContext(Port port_,
java.lang.Object data_,
java.lang.String state_)
isReadyForNextTask
public final boolean isReadyForNextTask()
locks
public final java.lang.String locks()
lock
protected final void lock(Component host_,
java.lang.Object o_)
- Specified by:
lock in class WorkerThread
unlock
protected final void unlock(Component host_,
java.lang.Object o_)
- Overrides:
unlock in class WorkerThread
unlock
protected void unlock(Component host_,
java.lang.Object o_,
boolean release_)
- Specified by:
unlock in class WorkerThread
releaseAllLocks
protected final void releaseAllLocks(Component host_)
- Specified by:
releaseAllLocks in class WorkerThread
wait
protected final void wait(Component host_,
java.lang.Object o_)
- Specified by:
wait in class WorkerThread
notify
protected final void notify(Component host_,
java.lang.Object o_)
- Specified by:
notify in class WorkerThread
notifyAll
protected final void notifyAll(Component host_,
java.lang.Object o_)
- Specified by:
notifyAll in class WorkerThread
yieldToRuntime
protected void yieldToRuntime()
- Returns the thread that is holding the lock of the target object.
The returned thread may be an orphan thread from previous run.
final WorkerThread getHolder(Object o_)
{
Component host_ = getHost();
if (host_ == null) return null;
LockPack p_ = lookforLock(host_, o_);
return p_ == null? null: p_.holder;
}
- Specified by:
yieldToRuntime in class WorkerThread
setState
protected final void setState(java.lang.String new_)
- Overrides:
setState in class WorkerThread
Copyright © 1998-2003 Distributed Real-time Computing Lab (DRCL). All Rights Reserved. ~ To J-Sim Home ~