|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Thread
ptolemy.actor.process.NotifyThread
public class NotifyThread
Helper thread for calling notifyAll() on a single lock or a LinkedList of locks. Since this is a new thread without any locks, calling notifyAll from this thread reduces the possibility of deadlocks.
To use this to wake up any threads waiting on a lock, create a new instance of this class with a LinkedList of lock objects (or single lock) to call notifyAll() on.
Yellow (mudit) |
Green (mudit) |
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.lang.Thread |
---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
Field Summary | |
---|---|
private java.lang.Object |
_lock
|
private java.util.LinkedList |
_locks
|
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
NotifyThread(java.util.LinkedList locks)
Construct a thread to be used call notifyAll() on a set of locks. |
|
NotifyThread(java.lang.Object lock)
Construct a thread to be used call notifyAll() on a set of locks. |
Method Summary | |
---|---|
void |
run()
Call NotifyAll() on the lock object (or objects) passed to this class in its constructor. |
Methods inherited from class java.lang.Thread |
---|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private java.util.LinkedList _locks
private java.lang.Object _lock
Constructor Detail |
---|
public NotifyThread(java.util.LinkedList locks)
locks
- The set of locks to call notifyAll() on.public NotifyThread(java.lang.Object lock)
lock
- The lock to call notifyAll() on.Method Detail |
---|
public void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |