Package ptolemy.actor.process
Class NotifyThread
- java.lang.Object
-
- java.lang.Thread
-
- ptolemy.actor.process.NotifyThread
-
- All Implemented Interfaces:
java.lang.Runnable
public class NotifyThread extends java.lang.Thread
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.
- Since:
- Ptolemy II 0.2
- Version:
- $Id$
- Author:
- Neil Smyth, Mudit Goel
- Pt.AcceptedRating:
- Yellow (mudit)
- Pt.ProposedRating:
- Green (mudit)
-
-
Constructor Summary
Constructors Constructor Description NotifyThread(java.lang.Object lock)
Construct a thread to be used call notifyAll() on a set of locks.NotifyThread(java.util.LinkedList locks)
Construct a thread to be used call notifyAll() on a set of locks.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
-
-
-
-
Constructor Detail
-
NotifyThread
public NotifyThread(java.util.LinkedList locks)
Construct a thread to be used call notifyAll() on a set of locks.- Parameters:
locks
- The set of locks to call notifyAll() on.
-
NotifyThread
public NotifyThread(java.lang.Object lock)
Construct a thread to be used call notifyAll() on a set of locks.- Parameters:
lock
- The lock to call notifyAll() on.
-
-