cz.vutbr.fit.racedetector
Class ERThreadInfoCollection

java.lang.Object
  extended by cz.vutbr.fit.racedetector.ERThreadInfoCollection

 class ERThreadInfoCollection
extends java.lang.Object

This class provides access to the set of ThreadInfo objects - each represents a thread accessing shared variable from RDVariable.

Author:
zdenek

Constructor Summary
ERThreadInfoCollection()
           
 
Method Summary
 void addThread(int thread, java.lang.String programLocation, RaceDetector.Operation mode)
          Adds thread to the set.
 void addThread(int thread, java.lang.String programLocation, RaceDetector.Operation mode, ERVariable.State status, java.util.Set<javolution.util.Index> locks)
          Adds thread to the set.
 void clearThreads()
          Clear the set - remove all ThreadInfo objects from the set.
 void clearThreadsAcceptCurrent()
          Clean the set - remove all ThreadInfo objects from the set accept that representing current thread.
 boolean containsThread(int thread)
          Returns true if the record containing given thread exists.
 java.lang.String generateVarReport()
          Generates basic report based on informations stored in ThreadInfoCollection - a set of threads accessing the variable.
 java.util.Set<javolution.util.Index> getVarThreadSet()
          Returns the set of threads accessing the variable.
 void updateThreadInfo(int thread, java.lang.String programLocation, RaceDetector.Operation mode)
          Updates ThreadInfo record of given thread.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ERThreadInfoCollection

ERThreadInfoCollection()
Method Detail

containsThread

public boolean containsThread(int thread)
Returns true if the record containing given thread exists.


clearThreads

public void clearThreads()
Clear the set - remove all ThreadInfo objects from the set.


clearThreadsAcceptCurrent

public void clearThreadsAcceptCurrent()
Clean the set - remove all ThreadInfo objects from the set accept that representing current thread.


addThread

public void addThread(int thread,
                      java.lang.String programLocation,
                      RaceDetector.Operation mode,
                      ERVariable.State status,
                      java.util.Set<javolution.util.Index> locks)
Adds thread to the set. If the thread record is already present - the candidate locks set is updated. Also maintains the candidate locks set.

Parameters:
thread -
programLocation -
mode -
status -
locks -

addThread

public void addThread(int thread,
                      java.lang.String programLocation,
                      RaceDetector.Operation mode)
Adds thread to the set.

Parameters:
thread -
programLocation -
mode -

updateThreadInfo

public void updateThreadInfo(int thread,
                             java.lang.String programLocation,
                             RaceDetector.Operation mode)
Updates ThreadInfo record of given thread. Set the last programLocation and accessMode of this thread to the variable.

Parameters:
thread -
programLocation -
mode -

generateVarReport

public java.lang.String generateVarReport()
Generates basic report based on informations stored in ThreadInfoCollection - a set of threads accessing the variable.


getVarThreadSet

public java.util.Set<javolution.util.Index> getVarThreadSet()
Returns the set of threads accessing the variable.