cz.vutbr.fit.racedetector
Class ARVariable

java.lang.Object
  extended by cz.vutbr.fit.racedetector.RDVariable
      extended by cz.vutbr.fit.racedetector.ARVariable

public class ARVariable
extends RDVariable

This class implements the core of the atomicity race detecting algorithm and contains variable related information.

Atomicity race detecting algorithm checks if two or more threads are not accessing the parts of code that should be executed atomically simultaneously.

Author:
zdenek

Field Summary
 
Fields inherited from class cz.vutbr.fit.racedetector.RDVariable
healedByThreads, instance, raceAvoidLock, raceAvoidSemaphore, raceDetected, varName, varNoiseInject, varOmited
 
Constructor Summary
ARVariable(java.lang.Object ins, java.lang.String vName)
          constructor
 
Method Summary
 boolean afterAccess(ARThread art, java.lang.String programLocation)
          Things that should be done before the access to the variable: If this thread is inside the critical section of this variable and the given program location is the end of the atomic section - stop checking.
 boolean beforeAccess(ARThread art, java.lang.String programLocation, RaceDetector.Operation operation, Atomicity beginAtom)
          Things that should be done before the access to the variable: Check if someone else is not in the critical section of this variable (if is - than conflict is detected).
 
Methods inherited from class cz.vutbr.fit.racedetector.RDVariable
prepareHealing
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ARVariable

public ARVariable(java.lang.Object ins,
                  java.lang.String vName)
constructor

Method Detail

beforeAccess

public boolean beforeAccess(ARThread art,
                            java.lang.String programLocation,
                            RaceDetector.Operation operation,
                            Atomicity beginAtom)
Things that should be done before the access to the variable: Check if someone else is not in the critical section of this variable (if is - than conflict is detected). If this is the start of some atomic section set the flag and store other useful information.

Parameters:
art - Thread related and cached information.
programLocation - Current program location.
operation - Type of the operation read/write.
beginAtom - Contains atomicity if there begins some at the current program location
Returns:
true if there is suspected race

afterAccess

public boolean afterAccess(ARThread art,
                           java.lang.String programLocation)
Things that should be done before the access to the variable: If this thread is inside the critical section of this variable and the given program location is the end of the atomic section - stop checking.

Parameters:
art - Thread related and cached information.
programLocation - Current program location.
Returns:
true if it was true race