Main Page   Packages   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

Monitor Class Reference

Inheritance diagram for Monitor:
[legend]
Collaboration diagram for Monitor:
[legend]
List of all members.

Public Methods

 Monitor ()
 Monitor (int lt, int lc, List wt)
boolean checkLock (ThreadInfo th)
boolean checkLockAfterNotified (ThreadInfo th)
Object clone ()
boolean equals (Object obj)
int getLockCount ()
int getLockingThread ()
List getWaitingThreads ()
void hash (HashData hd)
int hashCode ()
boolean lock (ThreadInfo th, Ref ref)
boolean lockAfterNotified (ThreadInfo th, Ref ref)
void notify (KernelState ks, Scheduler sch)
void notifyAll (KernelState ks)
void unlock (ThreadInfo th, Ref ref)
void wait (ThreadInfo th, Ref ref)
 Monitor ()
boolean canLock (ThreadInfo th)
Object clone ()
boolean equals (Object o)
int getLockCount ()
int getLockingThread ()
int[] getWaitingThreads ()
void hash (HashData hd)
int hashCode ()
void interrupt (ThreadInfo th)
void lock (ThreadInfo th, Ref ref)
void lockNotified (ThreadInfo th, Ref ref)
void log ()
void notify (SystemState ss)
void notifyAll (SystemState ss)
String toString ()
void unlock (ThreadInfo th, Ref ref)
void wait (ThreadInfo th, Ref ref)

Private Methods

void ANALYZE_lock (ThreadInfo th, Ref ref)
void ANALYZE_unlock (ThreadInfo th, Ref ref)
void ANALYZE_wait (ThreadInfo th, Ref ref)
void LOCKORDER_lock (ThreadInfo th, Ref ref)
void LOCKORDER_unlock (ThreadInfo th)
void LOCKORDER_wait (ThreadInfo th)
int remove (int index)

Private Attributes

int locking_thread = -1
int lock_count = 0
List waiting_threads = new ArrayList()
int lockingThread
int lockCount
int[] waitingThreads

Detailed Description

Represents the monitor associate with classes and objects.

Definition at line 12 of file lib/jpf/gov/nasa/arc/ase/jpf/jvm/Monitor.java.


Constructor & Destructor Documentation

Monitor::Monitor   [inline]
 

Creates a new empty monitor.

Definition at line 39 of file src/gov/nasa/arc/ase/jpf/jvm/Monitor.java.

Referenced by clone().


Member Function Documentation

boolean Monitor::canLock ThreadInfo   th [inline]
 

Returns true if it is possible to lock the monitor.

Definition at line 47 of file src/gov/nasa/arc/ase/jpf/jvm/Monitor.java.

Object Monitor::clone   [inline]
 

Creates a clone of the monitor.

Definition at line 55 of file src/gov/nasa/arc/ase/jpf/jvm/Monitor.java.

boolean Monitor::equals Object   o [inline]
 

Compares to another object.

Definition at line 68 of file src/gov/nasa/arc/ase/jpf/jvm/Monitor.java.

int Monitor::getLockCount   [inline]
 

Returns the number of nested locks acquired.

Definition at line 89 of file src/gov/nasa/arc/ase/jpf/jvm/Monitor.java.

Referenced by equals().

int Monitor::getLockingThread   [inline]
 

Returns the identifier of the thread holding the lock.

Definition at line 95 of file src/gov/nasa/arc/ase/jpf/jvm/Monitor.java.

Referenced by equals().

int [] Monitor::getWaitingThreads   [inline]
 

Returns the list of waiting threads.

Definition at line 101 of file src/gov/nasa/arc/ase/jpf/jvm/Monitor.java.

void Monitor::interrupt ThreadInfo   th [inline]
 

Interrupts one of the threads holding the lock.

Definition at line 121 of file src/gov/nasa/arc/ase/jpf/jvm/Monitor.java.

void Monitor::lock ThreadInfo   th,
Ref   ref
[inline]
 

Acquires the lock for a given object or class.

Definition at line 128 of file src/gov/nasa/arc/ase/jpf/jvm/Monitor.java.

void Monitor::lockNotified ThreadInfo   th,
Ref   ref
[inline]
 

Tries to require the lock after being notified.

Definition at line 143 of file src/gov/nasa/arc/ase/jpf/jvm/Monitor.java.

void Monitor::notify SystemState   ss [inline]
 

Notifies one of the threads. The thread is chosen non deterministically.

Definition at line 173 of file src/gov/nasa/arc/ase/jpf/jvm/Monitor.java.

void Monitor::notifyAll SystemState   ss [inline]
 

Notifies all waiting threads.

Definition at line 185 of file src/gov/nasa/arc/ase/jpf/jvm/Monitor.java.

void Monitor::unlock ThreadInfo   th,
Ref   ref
[inline]
 

Releases the lock. The lock can be still held by the thread if it had been locked more than once.

Definition at line 230 of file src/gov/nasa/arc/ase/jpf/jvm/Monitor.java.

void Monitor::wait ThreadInfo   th,
Ref   ref
[inline]
 

Waits to be notified. Releases the lock and waits.

Definition at line 246 of file src/gov/nasa/arc/ase/jpf/jvm/Monitor.java.


Member Data Documentation

int Monitor::lockCount [private]
 

The number of nested locks acquired.

Definition at line 29 of file src/gov/nasa/arc/ase/jpf/jvm/Monitor.java.

int Monitor::lockingThread [private]
 

The identifier of the thread locking an object.

Definition at line 24 of file src/gov/nasa/arc/ase/jpf/jvm/Monitor.java.

int [] Monitor::waitingThreads [private]
 

The list of threads waiting to be notified.

Definition at line 34 of file src/gov/nasa/arc/ase/jpf/jvm/Monitor.java.


The documentation for this class was generated from the following files:
Generated at Thu Feb 7 07:20:17 2002 for Bandera by doxygen1.2.10 written by Dimitri van Heesch, © 1997-2001